####Q1.1 PREFIX xsd: PREFIX schema: PREFIX inst: PREFIX owl: PREFIX gn: SELECT (SUM(?sum_revenue) as ?sum_sum_revenue) WHERE { { SERVICE { SELECT (SUM(?lo_extendedprice * ?lo_discount) AS ?sum_revenue) WHERE { ?li schema:lineorder . ?li schema:lo_discount ?lo_discount . ?li schema:lo_extendedprice ?lo_extendedprice . ?li schema:lo_quantity ?lo_quantity . FILTER((?lo_discount >= 1 ) && ((?lo_discount <= 3 ) && (?lo_quantity < 25 ))) . ?li schema:lo_orderdate ?orderdatekey . ?orderdatekey schema:year ?d_year . FILTER(?d_year = 1993 ) . } } } UNION { SERVICE { SELECT (SUM(?lo_extendedprice * ?lo_discount) AS ?sum_revenue) WHERE { ?li schema:lineorder . ?li schema:lo_discount ?lo_discount . ?li schema:lo_extendedprice ?lo_extendedprice . ?li schema:lo_quantity ?lo_quantity . FILTER((?lo_discount >= 1 ) && ((?lo_discount <= 3 ) && (?lo_quantity < 25 ))) . ?li schema:lo_orderdate ?orderdatekey . ?orderdatekey schema:year ?d_year . FILTER(?d_year = 1993 ) . } } } UNION { SERVICE { SELECT (SUM(?lo_extendedprice * ?lo_discount) AS ?sum_revenue) WHERE { ?li schema:lineorder . ?li schema:lo_discount ?lo_discount . ?li schema:lo_extendedprice ?lo_extendedprice . ?li schema:lo_quantity ?lo_quantity . FILTER((?lo_discount >= 1 ) && ((?lo_discount <= 3 ) && (?lo_quantity < 25 ))) . ?li schema:lo_orderdate ?orderdatekey . ?orderdatekey schema:year ?d_year . FILTER(?d_year = 1993 ) . } } } UNION { SERVICE { SELECT (SUM(?lo_extendedprice * ?lo_discount) AS ?sum_revenue) WHERE { ?li schema:lineorder . ?li schema:lo_discount ?lo_discount . ?li schema:lo_extendedprice ?lo_extendedprice . ?li schema:lo_quantity ?lo_quantity . FILTER((?lo_discount >= 1 ) && ((?lo_discount <= 3 ) && (?lo_quantity < 25 ))) . ?li schema:lo_orderdate ?orderdatekey . ?orderdatekey schema:year ?d_year . FILTER(?d_year = 1993 ) . } } } UNION { SERVICE { SELECT (SUM(?lo_extendedprice * ?lo_discount) AS ?sum_revenue) WHERE { ?li schema:lineorder . ?li schema:lo_discount ?lo_discount . ?li schema:lo_extendedprice ?lo_extendedprice . ?li schema:lo_quantity ?lo_quantity . FILTER((?lo_discount >= 1 ) && ((?lo_discount <= 3 ) && (?lo_quantity < 25 ))) . ?li schema:lo_orderdate ?orderdatekey_var1 . orderdatekey_var1 schema:valueOf ?orderdatekey . ?orderdatekey schema:year ?d_year . FILTER(?d_year = 1993 ) . } } } } ####Q1.2 PREFIX xsd: PREFIX schema: PREFIX inst: PREFIX owl: PREFIX gn: SELECT (SUM(?sum_revenue) as ?sum_sum_revenue) WHERE { { SERVICE { SELECT (SUM(?lo_extendedprice * ?lo_discount) AS ?sum_revenue) WHERE { ?li schema:lineorder . ?li schema:lo_discount ?lo_discount . ?li schema:lo_extendedprice ?lo_extendedprice . ?li schema:lo_quantity ?lo_quantity . FILTER((?lo_discount >= 1 ) && ((?lo_discount <= 3 ) && (?lo_quantity < 25 ))) . ?li schema:lo_orderdate ?orderdatekey . ?orderdatekey schema:month ?d_month . ?orderdatekey schema:year ?d_year . FILTER((?d_year = 1993 ) && (?d_month = "January")) . } } } UNION { SERVICE { SELECT (SUM(?lo_extendedprice * ?lo_discount) AS ?sum_revenue) WHERE { ?li schema:lineorder . ?li schema:lo_discount ?lo_discount . ?li schema:lo_extendedprice ?lo_extendedprice . ?li schema:lo_quantity ?lo_quantity . FILTER((?lo_discount >= 1 ) && ((?lo_discount <= 3 ) && (?lo_quantity < 25 ))) . ?li schema:lo_orderdate ?orderdatekey . ?orderdatekey schema:month ?d_month . ?orderdatekey schema:year ?d_year . FILTER((?d_year = 1993 ) && (?d_month = "January")) . } } } UNION { SERVICE { SELECT (SUM(?lo_extendedprice * ?lo_discount) AS ?sum_revenue) WHERE { ?li schema:lineorder . ?li schema:lo_discount ?lo_discount . ?li schema:lo_extendedprice ?lo_extendedprice . ?li schema:lo_quantity ?lo_quantity . FILTER((?lo_discount >= 1 ) && ((?lo_discount <= 3 ) && (?lo_quantity < 25 ))) . ?li schema:lo_orderdate ?orderdatekey . ?orderdatekey schema:month ?d_month . ?orderdatekey schema:year ?d_year . FILTER((?d_year = 1993 ) && (?d_month = "January")) . } } } UNION { SERVICE { SELECT (SUM(?lo_extendedprice * ?lo_discount) AS ?sum_revenue) WHERE { ?li schema:lineorder . ?li schema:lo_discount ?lo_discount . ?li schema:lo_extendedprice ?lo_extendedprice . ?li schema:lo_quantity ?lo_quantity . FILTER((?lo_discount >= 1 ) && ((?lo_discount <= 3 ) && (?lo_quantity < 25 ))) . ?li schema:lo_orderdate ?orderdatekey . ?orderdatekey schema:month ?d_month . ?orderdatekey schema:year ?d_year . FILTER((?d_year = 1993 ) && (?d_month = "January")) . } } } UNION { SERVICE { SELECT (SUM(?lo_extendedprice * ?lo_discount) AS ?sum_revenue) WHERE { ?li schema:lineorder . ?li schema:lo_discount ?lo_discount . ?li schema:lo_extendedprice ?lo_extendedprice . ?li schema:lo_quantity ?lo_quantity . FILTER((?lo_discount >= 1 ) && ((?lo_discount <= 3 ) && (?lo_quantity < 25 ))) . ?li schema:lo_orderdate ?orderdatekey_var1 . ?orderdatekey_var1 schema:valueOf ?orderdatekey . ?orderdatekey schema:month ?d_month . ?orderdatekey schema:year ?d_year . FILTER((?d_year = 1993 ) && (?d_month = "January")) . } } } } ####Q1.3 PREFIX xsd: PREFIX schema: PREFIX inst: PREFIX owl: PREFIX gn: SELECT (SUM(?sum_revenue) as ?sum_sum_revenue) WHERE { { SERVICE { SELECT (SUM(?lo_extendedprice * ?lo_discount) AS ?sum_revenue) WHERE { ?li schema:lineorder . ?li schema:lo_discount ?lo_discount . ?li schema:lo_extendedprice ?lo_extendedprice . ?li schema:lo_quantity ?lo_quantity . FILTER((?lo_discount >= 5 ) && ((?lo_discount <= 7 ) && ((?lo_quantity >= 26 ) && (?lo_quantity <= 35 )))) . ?li schema:lo_orderdate ?orderdatekey . ?orderdatekey schema:weeknuminyear ?d_weeknuminyear . ?orderdatekey schema:year ?d_year . FILTER((?d_weeknuminyear = 6 ) && (?d_year = 1994 )) . } } } UNION { SERVICE { SELECT (SUM(?lo_extendedprice * ?lo_discount) AS ?sum_revenue) WHERE { ?li schema:lineorder . ?li schema:lo_discount ?lo_discount . ?li schema:lo_extendedprice ?lo_extendedprice . ?li schema:lo_quantity ?lo_quantity . FILTER((?lo_discount >= 5 ) && ((?lo_discount <= 7 ) && ((?lo_quantity >= 26 ) && (?lo_quantity <= 35 )))) . ?li schema:lo_orderdate ?orderdatekey . ?orderdatekey schema:weeknuminyear ?d_weeknuminyear . ?orderdatekey schema:year ?d_year . FILTER((?d_weeknuminyear = 6 ) && (?d_year = 1994 )) . } } } UNION { SERVICE { SELECT (SUM(?lo_extendedprice * ?lo_discount) AS ?sum_revenue) WHERE { ?li schema:lineorder . ?li schema:lo_discount ?lo_discount . ?li schema:lo_extendedprice ?lo_extendedprice . ?li schema:lo_quantity ?lo_quantity . FILTER((?lo_discount >= 5 ) && ((?lo_discount <= 7 ) && ((?lo_quantity >= 26 ) && (?lo_quantity <= 35 )))) . ?li schema:lo_orderdate ?orderdatekey . ?orderdatekey schema:weeknuminyear ?d_weeknuminyear . ?orderdatekey schema:year ?d_year . FILTER((?d_weeknuminyear = 6 ) && (?d_year = 1994 )) . } } } UNION { SERVICE { SELECT (SUM(?lo_extendedprice * ?lo_discount) AS ?sum_revenue) WHERE { ?li schema:lineorder . ?li schema:lo_discount ?lo_discount . ?li schema:lo_extendedprice ?lo_extendedprice . ?li schema:lo_quantity ?lo_quantity . FILTER((?lo_discount >= 5 ) && ((?lo_discount <= 7 ) && ((?lo_quantity >= 26 ) && (?lo_quantity <= 35 )))) . ?li schema:lo_orderdate ?orderdatekey . ?orderdatekey schema:weeknuminyear ?d_weeknuminyear . ?orderdatekey schema:year ?d_year . FILTER((?d_weeknuminyear = 6 ) && (?d_year = 1994 )) . } } } UNION { SERVICE { SELECT (SUM(?lo_extendedprice * ?lo_discount) AS ?sum_revenue) WHERE { ?li schema:lineorder . ?li schema:lo_discount ?lo_discount . ?li schema:lo_extendedprice ?lo_extendedprice . ?li schema:lo_quantity ?lo_quantity . FILTER((?lo_discount >= 5 ) && ((?lo_discount <= 7 ) && ((?lo_quantity >= 26 ) && (?lo_quantity <= 35 )))) . ?li schema:lo_orderdate ?orderdatekey_var1 . ?orderdatekey_var1 schema:valueOf ?orderdatekey . ?orderdatekey schema:weeknuminyear ?d_weeknuminyear . ?orderdatekey schema:year ?d_year . FILTER((?d_weeknuminyear = 6 ) && (?d_year = 1994 )) . } } } } ####Q2.1 PREFIX xsd: PREFIX schema: PREFIX inst: PREFIX owl: PREFIX gn: SELECT (SUM(?sum_revenue) as ?sum_sum_revenue) ?d_year ?p_brand1 ?s_cont_name WHERE { { SERVICE { SELECT (SUM(?revenue) AS ?sum_revenue) ?d_year ?p_brand1 ?s_cont_name WHERE { ?li schema:lineorder . ?li schema:lo_partkey ?lo_partkey_var1 . ?lo_partkey_var1 schema:valueOf ?lo_partkey . ?lo_partkey schema:category "MFGR#12" . ?li schema:lo_orderdate ?orderdatekey . ?li schema:lo_revenue ?revenue . ?li schema:lo_suppkey ?suppkey . ?lo_partkey schema:brand1 ?p_brand1 . ?orderdatekey schema:year ?d_year . ?suppkey schema:supregion "AMERICA" . ?suppkey schema:supcity ?s_city . ?s_city owl:sameAs ?geo_scity . SERVICE { ?geo_scity gn:parentCountry ?s_country . ?s_country gn:parentFeature ?s_continent . ?s_continent gn:name ?s_cont_name . } } GROUP BY ?d_year ?p_brand1 ?s_cont_name } } UNION { SERVICE { SELECT (SUM(?revenue) AS ?sum_revenue) ?d_year ?p_brand1 ?s_cont_name WHERE { ?li schema:lineorder . ?li schema:lo_partkey ?lo_partkey . ?lo_partkey schema:category "MFGR#12" . ?li schema:lo_orderdate ?orderdatekey . ?li schema:lo_revenue ?revenue . ?li schema:lo_suppkey ?suppkey_var1 . ?suppkey_var1 schema:valueOf ?suppkey . ?lo_partkey schema:brand1 ?p_brand1 . ?orderdatekey schema:year ?d_year . ?suppkey schema:supregion "AMERICA" . ?suppkey schema:supcity ?s_city . ?s_city owl:sameAs ?geo_scity . SERVICE { ?geo_scity gn:parentCountry ?s_country . ?s_country gn:parentFeature ?s_continent . ?s_continent gn:name ?s_cont_name . } } GROUP BY ?d_year ?p_brand1 ?s_cont_name } } UNION { SERVICE { SELECT (SUM(?revenue) AS ?sum_revenue) ?d_year ?p_brand1 ?s_cont_name WHERE { ?li schema:lineorder . ?li schema:lo_partkey ?lo_partkey . ?lo_partkey schema:category "MFGR#12" . ?li schema:lo_orderdate ?orderdatekey . ?li schema:lo_revenue ?revenue . ?li schema:lo_suppkey ?suppkey . ?lo_partkey schema:brand1 ?p_brand1 . ?orderdatekey schema:year ?d_year . ?suppkey schema:supregion "AMERICA" . ?suppkey schema:supcity ?s_city . ?s_city owl:sameAs ?geo_scity . SERVICE { ?geo_scity gn:parentCountry ?s_country . ?s_country gn:parentFeature ?s_continent . ?s_continent gn:name ?s_cont_name . } } GROUP BY ?d_year ?p_brand1 ?s_cont_name } } UNION { SERVICE { SELECT (SUM(?revenue) AS ?sum_revenue) ?d_year ?p_brand1 ?s_cont_name WHERE { ?li schema:lineorder . ?li schema:lo_partkey ?lo_partkey . ?lo_partkey schema:category "MFGR#12" . ?li schema:lo_orderdate ?orderdatekey . ?li schema:lo_revenue ?revenue_var1 . ?revenue_var1 schema:valueOf ?revenue . ?li schema:lo_suppkey ?suppkey . ?lo_partkey schema:brand1 ?p_brand1 . ?orderdatekey schema:year ?d_year . ?suppkey schema:supregion "AMERICA" . ?suppkey schema:supcity ?s_city . ?s_city owl:sameAs ?geo_scity . SERVICE { ?geo_scity gn:parentCountry ?s_country . ?s_country gn:parentFeature ?s_continent . ?s_continent gn:name ?s_cont_name . } } GROUP BY ?d_year ?p_brand1 ?s_cont_name } } UNION { SERVICE { SELECT (SUM(?revenue) AS ?sum_revenue) ?d_year ?p_brand1 ?s_cont_name WHERE { ?li schema:lineorder . ?li schema:lo_partkey ?lo_partkey . ?lo_partkey schema:category "MFGR#12" . ?li schema:lo_orderdate ?orderdatekey_var1 . ?orderdatekey_var1 schema:valueOf ?orderdatekey . ?li schema:lo_revenue ?revenue . ?li schema:lo_suppkey ?suppkey . ?lo_partkey schema:brand1 ?p_brand1 . ?orderdatekey schema:year ?d_year . ?suppkey schema:supregion "AMERICA" . ?suppkey schema:supcity ?s_city . ?s_city owl:sameAs ?geo_scity . SERVICE { ?geo_scity gn:parentCountry ?s_country . ?s_country gn:parentFeature ?s_continent . ?s_continent gn:name ?s_cont_name . } } GROUP BY ?d_year ?p_brand1 ?s_cont_name } } } GROUP BY ?d_year ?p_brand1 ?s_cont_name ####Q2.2 PREFIX xsd: PREFIX schema: PREFIX inst: PREFIX owl: PREFIX gn: SELECT (SUM(?sum_revenue) as ?sum_sum_revenue) ?d_year ?p_brand1 ?s_cont_name WHERE { { SERVICE { SELECT (SUM(?revenue) AS ?sum_revenue) ?d_year ?p_brand1 ?s_cont_name WHERE { ?li schema:lineorder . ?li schema:lo_custkey ?custkey . ?li schema:lo_partkey ?lo_partkey_var1 . ?lo_partkey_var1 schema:valueOf ?lo_partkey . ?li schema:lo_orderdate ?orderdatekey . ?li schema:lo_revenue ?revenue . ?li schema:lo_suppkey ?suppkey . ?lo_partkey schema:brand1 ?p_brand1 . FILTER((STR(?p_brand1) >= "MFGR#2221") && (STR(?p_brand1) <= "MFGR#2228")) . ?orderdatekey schema:year ?d_year . ?suppkey schema:supregion "ASIA" . ?suppkey schema:supcity ?s_city . ?s_city owl:sameAs ?geo_scity . SERVICE { ?geo_scity gn:parentCountry ?s_country . ?s_country gn:parentFeature ?s_continent . ?s_continent gn:name ?s_cont_name . } } GROUP BY ?d_year ?p_brand1 ?s_cont_name } } UNION { SERVICE { SELECT (SUM(?revenue) AS ?sum_revenue) ?d_year ?p_brand1 ?s_cont_name WHERE { ?li schema:lineorder . ?li schema:lo_custkey ?custkey . ?li schema:lo_partkey ?lo_partkey . ?li schema:lo_orderdate ?orderdatekey . ?li schema:lo_revenue ?revenue . ?li schema:lo_suppkey ?suppkey_var1 . ?suppkey_var1 schema:valueOf ?suppkey . ?lo_partkey schema:brand1 ?p_brand1 . FILTER((STR(?p_brand1) >= "MFGR#2221") && (STR(?p_brand1) <= "MFGR#2228")) . ?orderdatekey schema:year ?d_year . ?suppkey schema:supregion "ASIA" . ?suppkey schema:supcity ?s_city . ?s_city owl:sameAs ?geo_scity . SERVICE { ?geo_scity gn:parentCountry ?s_country . ?s_country gn:parentFeature ?s_continent . ?s_continent gn:name ?s_cont_name . } } GROUP BY ?d_year ?p_brand1 ?s_cont_name } } UNION { SERVICE { SELECT (SUM(?revenue) AS ?sum_revenue) ?d_year ?p_brand1 ?s_cont_name WHERE { ?li schema:lineorder . ?li schema:lo_custkey ?custkey_var1 . ?custkey_var1 schema:valueOf ?custkey . ?li schema:lo_partkey ?lo_partkey . ?li schema:lo_orderdate ?orderdatekey . ?li schema:lo_revenue ?revenue . ?li schema:lo_suppkey ?suppkey . ?lo_partkey schema:brand1 ?p_brand1 . FILTER((STR(?p_brand1) >= "MFGR#2221") && (STR(?p_brand1) <= "MFGR#2228")) . ?orderdatekey schema:year ?d_year . ?suppkey schema:supregion "ASIA" . ?suppkey schema:supcity ?s_city . ?s_city owl:sameAs ?geo_scity . SERVICE { ?geo_scity gn:parentCountry ?s_country . ?s_country gn:parentFeature ?s_continent . ?s_continent gn:name ?s_cont_name . } } GROUP BY ?d_year ?p_brand1 ?s_cont_name } } UNION { SERVICE { SELECT (SUM(?revenue) AS ?sum_revenue) ?d_year ?p_brand1 ?s_cont_name WHERE { ?li schema:lineorder . ?li schema:lo_custkey ?custkey . ?li schema:lo_partkey ?lo_partkey . ?li schema:lo_orderdate ?orderdatekey . ?li schema:lo_revenue ?revenue_var1 . ?revenue_var1 schema:valueOf ?revenue . ?li schema:lo_suppkey ?suppkey . ?lo_partkey schema:brand1 ?p_brand1 . FILTER((STR(?p_brand1) >= "MFGR#2221") && (STR(?p_brand1) <= "MFGR#2228")) . ?orderdatekey schema:year ?d_year . ?suppkey schema:supregion "ASIA" . ?suppkey schema:supcity ?s_city . ?s_city owl:sameAs ?geo_scity . SERVICE { ?geo_scity gn:parentCountry ?s_country . ?s_country gn:parentFeature ?s_continent . ?s_continent gn:name ?s_cont_name . } } GROUP BY ?d_year ?p_brand1 ?s_cont_name } } UNION { SERVICE { SELECT (SUM(?revenue) AS ?sum_revenue) ?d_year ?p_brand1 ?s_cont_name WHERE { ?li schema:lineorder . ?li schema:lo_custkey ?custkey . ?li schema:lo_partkey ?lo_partkey . ?li schema:lo_orderdate ?orderdatekey_var1 . ?orderdatekey_var1 schema:valueOf ?orderdatekey . ?li schema:lo_revenue ?revenue . ?li schema:lo_suppkey ?suppkey . ?lo_partkey schema:brand1 ?p_brand1 . FILTER((STR(?p_brand1) >= "MFGR#2221") && (STR(?p_brand1) <= "MFGR#2228")) . ?orderdatekey schema:year ?d_year . ?suppkey schema:supregion "ASIA" . ?suppkey schema:supcity ?s_city . ?s_city owl:sameAs ?geo_scity . SERVICE { ?geo_scity gn:parentCountry ?s_country . ?s_country gn:parentFeature ?s_continent . ?s_continent gn:name ?s_cont_name . } } GROUP BY ?d_year ?p_brand1 ?s_cont_name } } } GROUP BY ?d_year ?p_brand1 ?s_cont_name ####Q2.3 PREFIX xsd: PREFIX schema: PREFIX inst: PREFIX owl: PREFIX gn: SELECT (SUM(?sum_revenue) as ?sum_sum_revenue) ?d_year ?p_brand1 ?s_cont_name WHERE { { SERVICE { SELECT (SUM(?revenue) AS ?sum_revenue) ?d_year ?p_brand1 ?s_cont_name WHERE { ?li schema:lineorder . ?li schema:lo_partkey ?lo_partkey_var1 . ?lo_partkey_var1 schema:valueOf ?lo_partkey . ?li schema:lo_orderdate ?orderdatekey . ?li schema:lo_revenue ?revenue . ?li schema:lo_suppkey ?suppkey . ?lo_partkey schema:brand1 ?p_brand1 . FILTER(STR(?p_brand1) = "MFGR#2239") . ?orderdatekey schema:year ?d_year . ?suppkey schema:supregion "EUROPE" . ?suppkey schema:supcity ?s_city . ?s_city owl:sameAs ?geo_scity . SERVICE { ?geo_scity gn:parentCountry ?s_country . ?s_country gn:parentFeature ?s_continent . ?s_continent gn:name ?s_cont_name . } } GROUP BY ?d_year ?p_brand1 ?s_cont_name } } UNION { SERVICE { SELECT (SUM(?revenue) AS ?sum_revenue) ?d_year ?p_brand1 ?s_cont_name WHERE { ?li schema:lineorder . ?li schema:lo_partkey ?lo_partkey . ?li schema:lo_orderdate ?orderdatekey . ?li schema:lo_revenue ?revenue . ?li schema:lo_suppkey ?suppkey_var1 . ?suppkey_var1 schema:valueOf ?suppkey . ?lo_partkey schema:brand1 ?p_brand1 . FILTER(STR(?p_brand1) = "MFGR#2239") . ?orderdatekey schema:year ?d_year . ?suppkey schema:supregion "EUROPE" . ?suppkey schema:supcity ?s_city . ?s_city owl:sameAs ?geo_scity . SERVICE { ?geo_scity gn:parentCountry ?s_country . ?s_country gn:parentFeature ?s_continent . ?s_continent gn:name ?s_cont_name . } } GROUP BY ?d_year ?p_brand1 ?s_cont_name } } UNION { SERVICE { SELECT (SUM(?revenue) AS ?sum_revenue) ?d_year ?p_brand1 ?s_cont_name WHERE { ?li schema:lineorder . ?li schema:lo_partkey ?lo_partkey . ?li schema:lo_orderdate ?orderdatekey . ?li schema:lo_revenue ?revenue . ?li schema:lo_suppkey ?suppkey . ?lo_partkey schema:brand1 ?p_brand1 . FILTER(STR(?p_brand1) = "MFGR#2239") . ?orderdatekey schema:year ?d_year . ?suppkey schema:supregion "EUROPE" . ?suppkey schema:supcity ?s_city . ?s_city owl:sameAs ?geo_scity . SERVICE { ?geo_scity gn:parentCountry ?s_country . ?s_country gn:parentFeature ?s_continent . ?s_continent gn:name ?s_cont_name . } } GROUP BY ?d_year ?p_brand1 ?s_cont_name } } UNION { SERVICE { SELECT (SUM(?revenue) AS ?sum_revenue) ?d_year ?p_brand1 ?s_cont_name WHERE { ?li schema:lineorder . ?li schema:lo_partkey ?lo_partkey . ?li schema:lo_orderdate ?orderdatekey . ?li schema:lo_revenue ?revenue_var1 . ?revenue_var1 schema:valueOf ?revenue . ?li schema:lo_suppkey ?suppkey . ?lo_partkey schema:brand1 ?p_brand1 . FILTER(STR(?p_brand1) = "MFGR#2239") . ?orderdatekey schema:year ?d_year . ?suppkey schema:supregion "EUROPE" . ?suppkey schema:supcity ?s_city . ?s_city owl:sameAs ?geo_scity . SERVICE { ?geo_scity gn:parentCountry ?s_country . ?s_country gn:parentFeature ?s_continent . ?s_continent gn:name ?s_cont_name . } } GROUP BY ?d_year ?p_brand1 ?s_cont_name } } UNION { SERVICE { SELECT (SUM(?revenue) AS ?sum_revenue) ?d_year ?p_brand1 ?s_cont_name WHERE { ?li schema:lineorder . ?li schema:lo_partkey ?lo_partkey . ?li schema:lo_orderdate ?orderdatekey_var1 . ?orderdatekey_var1 schema:valueOf ?orderdatekey . ?li schema:lo_revenue ?revenue . ?li schema:lo_suppkey ?suppkey . ?lo_partkey schema:brand1 ?p_brand1 . FILTER(STR(?p_brand1) = "MFGR#2239") . ?orderdatekey schema:year ?d_year . ?suppkey schema:supregion "EUROPE" . ?suppkey schema:supcity ?s_city . ?s_city owl:sameAs ?geo_scity . SERVICE { ?geo_scity gn:parentCountry ?s_country . ?s_country gn:parentFeature ?s_continent . ?s_continent gn:name ?s_cont_name . } } GROUP BY ?d_year ?p_brand1 ?s_cont_name } } } GROUP BY ?d_year ?p_brand1 ?s_cont_name ####Q3.1 PREFIX xsd: PREFIX schema: PREFIX inst: PREFIX owl: PREFIX gn: SELECT ?c_nation ?s_nation ?d_year ?s_reg_name ?c_reg_name (SUM(?sum_revenue) as ?sum_sum_revenue) WHERE { { SERVICE { SELECT ?c_nation ?s_nation ?d_year ?s_reg_name ?c_reg_name (SUM(?revenue) AS ?sum_revenue) WHERE { ?custkey schema:custregion "ASIA" . ?custkey schema:custcity ?c_city . ?custkey schema:custnation ?c_nation . ?li schema:lo_custkey ?custkey . ?li schema:lineorder . ?c_city owl:sameAs ?geo_ccity . ?li schema:lo_orderdate ?orderdatekey . ?orderdatekey schema:year ?d_year . FILTER((?d_year >= 1992 ) && (?d_year <= 1997 )) . ?li schema:lo_revenue ?revenue . ?li schema:lo_suppkey ?suppkey . ?suppkey schema:supregion "ASIA" . ?suppkey schema:supcity ?s_city . ?suppkey schema:supnation ?s_nation . ?s_city owl:sameAs ?geo_scity . SERVICE { ?geo_ccity gn:parentADM1 ?c_adm1 . ?geo_scity gn:parentADM1 ?s_adm1 . ?c_adm1 gn:name ?c_reg_name . ?s_adm1 gn:name ?s_reg_name . } } GROUP BY ?c_nation ?s_nation ?d_year ?s_reg_name ?c_reg_name } } UNION { SERVICE { SELECT ?c_nation ?s_nation ?d_year ?s_reg_name ?c_reg_name (SUM(?revenue) AS ?sum_revenue) WHERE { ?custkey schema:custregion "ASIA" . ?custkey schema:custcity ?c_city . ?custkey schema:custnation ?c_nation . ?li schema:lo_custkey ?custkey . ?li schema:lineorder . ?c_city owl:sameAs ?geo_ccity . ?li schema:lo_orderdate ?orderdatekey . ?orderdatekey schema:year ?d_year . FILTER((?d_year >= 1992 ) && (?d_year <= 1997 )) . ?li schema:lo_revenue ?revenue . ?li schema:lo_suppkey ?suppkey_var1 . ?suppkey_var1 schema:valueOf ?suppkey . ?suppkey schema:supregion "ASIA" . ?suppkey schema:supcity ?s_city . ?suppkey schema:supnation ?s_nation . ?s_city owl:sameAs ?geo_scity . SERVICE { ?geo_ccity gn:parentADM1 ?c_adm1 . ?geo_scity gn:parentADM1 ?s_adm1 . ?c_adm1 gn:name ?c_reg_name . ?s_adm1 gn:name ?s_reg_name . } } GROUP BY ?c_nation ?s_nation ?d_year ?s_reg_name ?c_reg_name } } UNION { SERVICE { SELECT ?c_nation ?s_nation ?d_year ?s_reg_name ?c_reg_name (SUM(?revenue) AS ?sum_revenue) WHERE { ?custkey schema:custregion "ASIA" . ?custkey schema:custcity ?c_city . ?custkey schema:custnation ?c_nation . ?li schema:lo_custkey ?custkey_var1 . ?custkey_var1 schema:valueOf ?custkey . ?li schema:lineorder . ?c_city owl:sameAs ?geo_ccity . ?li schema:lo_orderdate ?orderdatekey . ?orderdatekey schema:year ?d_year . FILTER((?d_year >= 1992 ) && (?d_year <= 1997 )) . ?li schema:lo_revenue ?revenue . ?li schema:lo_suppkey ?suppkey . ?suppkey schema:supregion "ASIA" . ?suppkey schema:supcity ?s_city . ?suppkey schema:supnation ?s_nation . ?s_city owl:sameAs ?geo_scity . SERVICE { ?geo_ccity gn:parentADM1 ?c_adm1 . ?geo_scity gn:parentADM1 ?s_adm1 . ?c_adm1 gn:name ?c_reg_name . ?s_adm1 gn:name ?s_reg_name . } } GROUP BY ?c_nation ?s_nation ?d_year ?s_reg_name ?c_reg_name } } UNION { SERVICE { SELECT ?c_nation ?s_nation ?d_year ?s_reg_name ?c_reg_name (SUM(?revenue) AS ?sum_revenue) WHERE { ?custkey schema:custregion "ASIA" . ?custkey schema:custcity ?c_city . ?custkey schema:custnation ?c_nation . ?li schema:lo_custkey ?custkey . ?li schema:lineorder . ?c_city owl:sameAs ?geo_ccity . ?li schema:lo_orderdate ?orderdatekey . ?orderdatekey schema:year ?d_year . FILTER((?d_year >= 1992 ) && (?d_year <= 1997 )) . ?li schema:lo_revenue ?revenue_var1 . ?revenue_var1 schema:valueOf ?revenue . ?li schema:lo_suppkey ?suppkey . ?suppkey schema:supregion "ASIA" . ?suppkey schema:supcity ?s_city . ?suppkey schema:supnation ?s_nation . ?s_city owl:sameAs ?geo_scity . SERVICE { ?geo_ccity gn:parentADM1 ?c_adm1 . ?geo_scity gn:parentADM1 ?s_adm1 . ?c_adm1 gn:name ?c_reg_name . ?s_adm1 gn:name ?s_reg_name . } } GROUP BY ?c_nation ?s_nation ?d_year ?s_reg_name ?c_reg_name } } UNION { SERVICE { SELECT ?c_nation ?s_nation ?d_year ?s_reg_name ?c_reg_name (SUM(?revenue) AS ?sum_revenue) WHERE { ?custkey schema:custregion "ASIA" . ?custkey schema:custcity ?c_city . ?custkey schema:custnation ?c_nation . ?li schema:lo_custkey ?custkey . ?li schema:lineorder . ?c_city owl:sameAs ?geo_ccity . ?li schema:lo_orderdate ?orderdatekey_var1 . ?orderdatekey_var1 schema:valueOf ?orderdatekey . ?orderdatekey schema:year ?d_year . FILTER((?d_year >= 1992 ) && (?d_year <= 1997 )) . ?li schema:lo_revenue ?revenue . ?li schema:lo_suppkey ?suppkey . ?suppkey schema:supregion "ASIA" . ?suppkey schema:supcity ?s_city . ?suppkey schema:supnation ?s_nation . ?s_city owl:sameAs ?geo_scity . SERVICE { ?geo_ccity gn:parentADM1 ?c_adm1 . ?geo_scity gn:parentADM1 ?s_adm1 . ?c_adm1 gn:name ?c_reg_name . ?s_adm1 gn:name ?s_reg_name . } } GROUP BY ?c_nation ?s_nation ?d_year ?s_reg_name ?c_reg_name } } } GROUP BY ?c_nation ?s_nation ?d_year ?s_reg_name ?c_reg_name ####Q3.2 PREFIX xsd: PREFIX schema: PREFIX inst: PREFIX owl: PREFIX gn: SELECT ?cust_adm1name ?sup_adm1name ?d_year (SUM(?sum_revenue) as ?sum_sum_revenue) WHERE { { SERVICE { SELECT ?cust_adm1name ?sup_adm1name ?d_year (SUM(?revenue) AS ?sum_revenue) WHERE { ?custnation schema:countryname "UNITED_STATES" . ?custkey schema:custnation ?custnation . ?custkey schema:custcity ?c_city . ?li schema:lo_custkey ?custkey . ?c_city owl:sameAs ?geo_ccity . ?li schema:lineorder . ?li schema:lo_orderdate ?orderdatekey . ?orderdatekey schema:year ?d_year . FILTER((?d_year >= 1992 ) && (?d_year <= 1997 )) . ?li schema:lo_revenue ?revenue . ?li schema:lo_suppkey ?suppkey . ?suppkey schema:supcity ?s_city . ?suppkey schema:supnation ?supnation . ?s_city owl:sameAs ?geo_scity . ?supnation schema:countryname "UNITED_STATES" . SERVICE { ?geo_ccity gn:parentFeature ?cust_adm1 . ?geo_scity gn:parentFeature ?sup_adm1 . ?cust_adm1 gn:name ?cust_adm1name . ?sup_adm1 gn:name ?sup_adm1name . } } GROUP BY ?cust_adm1name ?sup_adm1name ?d_year } } UNION { SERVICE { SELECT ?cust_adm1name ?sup_adm1name ?d_year (SUM(?revenue) AS ?sum_revenue) WHERE { ?custnation schema:countryname "UNITED_STATES" . ?custkey schema:custnation ?custnation . ?custkey schema:custcity ?c_city . ?li schema:lo_custkey ?custkey . ?c_city owl:sameAs ?geo_ccity . ?li schema:lineorder . ?li schema:lo_orderdate ?orderdatekey . ?orderdatekey schema:year ?d_year . FILTER((?d_year >= 1992 ) && (?d_year <= 1997 )) . ?li schema:lo_revenue ?revenue . ?li schema:lo_suppkey ?suppkey_var1 . ?suppkey_var1 schema:valueOf ?suppkey . ?suppkey schema:supcity ?s_city . ?suppkey schema:supnation ?supnation . ?s_city owl:sameAs ?geo_scity . ?supnation schema:countryname "UNITED_STATES" . SERVICE { ?geo_ccity gn:parentFeature ?cust_adm1 . ?geo_scity gn:parentFeature ?sup_adm1 . ?cust_adm1 gn:name ?cust_adm1name . ?sup_adm1 gn:name ?sup_adm1name . } } GROUP BY ?cust_adm1name ?sup_adm1name ?d_year } } UNION { SERVICE { SELECT ?cust_adm1name ?sup_adm1name ?d_year (SUM(?revenue) AS ?sum_revenue) WHERE { ?custnation schema:countryname "UNITED_STATES" . ?custkey schema:custnation ?custnation . ?custkey schema:custcity ?c_city . ?li schema:lo_custkey ?custkey_var1 . ?custkey_var1 schema:valueOf ?custkey . ?c_city owl:sameAs ?geo_ccity . ?li schema:lineorder . ?li schema:lo_orderdate ?orderdatekey . ?orderdatekey schema:year ?d_year . FILTER((?d_year >= 1992 ) && (?d_year <= 1997 )) . ?li schema:lo_revenue ?revenue . ?li schema:lo_suppkey ?suppkey . ?suppkey schema:supcity ?s_city . ?suppkey schema:supnation ?supnation . ?s_city owl:sameAs ?geo_scity . ?supnation schema:countryname "UNITED_STATES" . SERVICE { ?geo_ccity gn:parentFeature ?cust_adm1 . ?geo_scity gn:parentFeature ?sup_adm1 . ?cust_adm1 gn:name ?cust_adm1name . ?sup_adm1 gn:name ?sup_adm1name . } } GROUP BY ?cust_adm1name ?sup_adm1name ?d_year } } UNION { SERVICE { SELECT ?cust_adm1name ?sup_adm1name ?d_year (SUM(?revenue) AS ?sum_revenue) WHERE { ?custnation schema:countryname "UNITED_STATES" . ?custkey schema:custnation ?custnation . ?custkey schema:custcity ?c_city . ?li schema:lo_custkey ?custkey . ?c_city owl:sameAs ?geo_ccity . ?li schema:lineorder . ?li schema:lo_orderdate ?orderdatekey . ?orderdatekey schema:year ?d_year . FILTER((?d_year >= 1992 ) && (?d_year <= 1997 )) . ?li schema:lo_revenue ?revenue_var1 . ?revenue_var1 schema:valueOf ?revenue . ?li schema:lo_suppkey ?suppkey . ?suppkey schema:supcity ?s_city . ?suppkey schema:supnation ?supnation . ?s_city owl:sameAs ?geo_scity . ?supnation schema:countryname "UNITED_STATES" . SERVICE { ?geo_ccity gn:parentFeature ?cust_adm1 . ?geo_scity gn:parentFeature ?sup_adm1 . ?cust_adm1 gn:name ?cust_adm1name . ?sup_adm1 gn:name ?sup_adm1name . } } GROUP BY ?cust_adm1name ?sup_adm1name ?d_year } } UNION { SERVICE { SELECT ?cust_adm1name ?sup_adm1name ?d_year (SUM(?revenue) AS ?sum_revenue) WHERE { ?custnation schema:countryname "UNITED_STATES" . ?custkey schema:custnation ?custnation . ?custkey schema:custcity ?c_city . ?li schema:lo_custkey ?custkey . ?c_city owl:sameAs ?geo_ccity . ?li schema:lineorder . ?li schema:lo_orderdate ?orderdatekey_var1 . ?orderdatekey_var1 schema:valueOf ?orderdatekey . ?orderdatekey schema:year ?d_year . FILTER((?d_year >= 1992 ) && (?d_year <= 1997 )) . ?li schema:lo_revenue ?revenue . ?li schema:lo_suppkey ?suppkey . ?suppkey schema:supcity ?s_city . ?suppkey schema:supnation ?supnation . ?s_city owl:sameAs ?geo_scity . ?supnation schema:countryname "UNITED_STATES" . SERVICE { ?geo_ccity gn:parentFeature ?cust_adm1 . ?geo_scity gn:parentFeature ?sup_adm1 . ?cust_adm1 gn:name ?cust_adm1name . ?sup_adm1 gn:name ?sup_adm1name . } } GROUP BY ?cust_adm1name ?sup_adm1name ?d_year } } } GROUP BY ?cust_adm1name ?sup_adm1name ?d_year ####Q3.3 PREFIX xsd: PREFIX schema: PREFIX inst: PREFIX owl: PREFIX gn: SELECT ?cust_adm1name ?sup_adm1name ?d_year (SUM(?sum_revenue) as ?sum_sum_revenue) WHERE { { SERVICE { SELECT ?cust_adm1name ?sup_adm1name ?d_year (SUM(?revenue) AS ?sum_revenue) WHERE { ?li schema:lineorder . ?li schema:lo_custkey ?custkey . ?custkey schema:custcity ?c_city . ?li schema:lo_orderdate ?orderdatekey . ?c_city owl:sameAs ?geo_ccity . ?orderdatekey schema:year ?d_year . FILTER((?d_year >= 1992 ) && (?d_year <= 1997 )). ?li schema:lo_revenue ?revenue . ?li schema:lo_suppkey ?suppkey . ?suppkey schema:supcity ?s_city . FILTER(((?c_city = inst:city_UNITEDKI1) || (?c_city = inst:city_UNITEDKI5)) && ((?s_city = inst:city_UNITEDKI9) || (?s_city = inst:city_UNITEDKI5))). ?s_city owl:sameAs ?geo_scity . SERVICE { ?geo_ccity gn:parentFeature ?cust_adm1 . ?geo_scity gn:parentFeature ?sup_adm1 . ?cust_adm1 gn:name ?cust_adm1name . ?sup_adm1 gn:name ?sup_adm1name . } } GROUP BY ?cust_adm1name ?sup_adm1name ?d_year } } UNION { SERVICE { SELECT ?cust_adm1name ?sup_adm1name ?d_year (SUM(?revenue) AS ?sum_revenue) WHERE { ?li schema:lineorder . ?li schema:lo_custkey ?custkey . ?custkey schema:custcity ?c_city . ?li schema:lo_orderdate ?orderdatekey . ?c_city owl:sameAs ?geo_ccity . ?orderdatekey schema:year ?d_year . FILTER((?d_year >= 1992 ) && (?d_year <= 1997 )). ?li schema:lo_revenue ?revenue . ?li schema:lo_suppkey ?suppkey_var1 . ?suppkey_var1 schema:valueOf ?suppkey . ?suppkey schema:supcity ?s_city . FILTER(((?c_city = inst:city_UNITEDKI1) || (?c_city = inst:city_UNITEDKI5)) && ((?s_city = inst:city_UNITEDKI9) || (?s_city = inst:city_UNITEDKI5))). ?s_city owl:sameAs ?geo_scity . SERVICE { ?geo_ccity gn:parentFeature ?cust_adm1 . ?geo_scity gn:parentFeature ?sup_adm1 . ?cust_adm1 gn:name ?cust_adm1name . ?sup_adm1 gn:name ?sup_adm1name . } } GROUP BY ?cust_adm1name ?sup_adm1name ?d_year } } UNION { SERVICE { SELECT ?cust_adm1name ?sup_adm1name ?d_year (SUM(?revenue) AS ?sum_revenue) WHERE { ?li schema:lineorder . ?li schema:lo_custkey ?custkey_var1 . ?custkey_var1 schema:valueOf ?custkey . ?custkey schema:custcity ?c_city . ?li schema:lo_orderdate ?orderdatekey . ?c_city owl:sameAs ?geo_ccity . ?orderdatekey schema:year ?d_year . FILTER((?d_year >= 1992 ) && (?d_year <= 1997 )). ?li schema:lo_revenue ?revenue . ?li schema:lo_suppkey ?suppkey . ?suppkey schema:supcity ?s_city . FILTER(((?c_city = inst:city_UNITEDKI1) || (?c_city = inst:city_UNITEDKI5)) && ((?s_city = inst:city_UNITEDKI9) || (?s_city = inst:city_UNITEDKI5))). ?s_city owl:sameAs ?geo_scity . SERVICE { ?geo_ccity gn:parentFeature ?cust_adm1 . ?geo_scity gn:parentFeature ?sup_adm1 . ?cust_adm1 gn:name ?cust_adm1name . ?sup_adm1 gn:name ?sup_adm1name . } } GROUP BY ?cust_adm1name ?sup_adm1name ?d_year } } UNION { SERVICE { SELECT ?cust_adm1name ?sup_adm1name ?d_year (SUM(?revenue) AS ?sum_revenue) WHERE { ?li schema:lineorder . ?li schema:lo_custkey ?custkey . ?custkey schema:custcity ?c_city . ?li schema:lo_orderdate ?orderdatekey . ?c_city owl:sameAs ?geo_ccity . ?orderdatekey schema:year ?d_year . FILTER((?d_year >= 1992 ) && (?d_year <= 1997 )). ?li schema:lo_revenue ?revenue_var1 . ?revenue_var1 schema:valueOf ?revenue . ?li schema:lo_suppkey ?suppkey . ?suppkey schema:supcity ?s_city . FILTER(((?c_city = inst:city_UNITEDKI1) || (?c_city = inst:city_UNITEDKI5)) && ((?s_city = inst:city_UNITEDKI9) || (?s_city = inst:city_UNITEDKI5))). ?s_city owl:sameAs ?geo_scity . SERVICE { ?geo_ccity gn:parentFeature ?cust_adm1 . ?geo_scity gn:parentFeature ?sup_adm1 . ?cust_adm1 gn:name ?cust_adm1name . ?sup_adm1 gn:name ?sup_adm1name . } } GROUP BY ?cust_adm1name ?sup_adm1name ?d_year } } UNION { SERVICE { SELECT ?cust_adm1name ?sup_adm1name ?d_year (SUM(?revenue) AS ?sum_revenue) WHERE { ?li schema:lineorder . ?li schema:lo_custkey ?custkey . ?custkey schema:custcity ?c_city . ?li schema:lo_orderdate ?orderdatekey_var1 . ?orderdatekey_var1 schema:valueOf ?orderdatekey . ?c_city owl:sameAs ?geo_ccity . ?orderdatekey schema:year ?d_year . FILTER((?d_year >= 1992 ) && (?d_year <= 1997 )). ?li schema:lo_revenue ?revenue . ?li schema:lo_suppkey ?suppkey . ?suppkey schema:supcity ?s_city . FILTER(((?c_city = inst:city_UNITEDKI1) || (?c_city = inst:city_UNITEDKI5)) && ((?s_city = inst:city_UNITEDKI9) || (?s_city = inst:city_UNITEDKI5))). ?s_city owl:sameAs ?geo_scity . SERVICE { ?geo_ccity gn:parentFeature ?cust_adm1 . ?geo_scity gn:parentFeature ?sup_adm1 . ?cust_adm1 gn:name ?cust_adm1name . ?sup_adm1 gn:name ?sup_adm1name . } } GROUP BY ?cust_adm1name ?sup_adm1name ?d_year } } } GROUP BY ?cust_adm1name ?sup_adm1name ?d_year ####Q3.4 PREFIX xsd: PREFIX schema: PREFIX inst: PREFIX owl: PREFIX gn: SELECT ?cust_adm1name ?sup_adm1name ?d_year (SUM(?sum_revenue) as ?sum_sum_revenue) WHERE { { SERVICE { SELECT ?cust_adm1name ?sup_adm1name ?d_year (SUM(?revenue) AS ?sum_revenue) WHERE { ?li schema:lineorder . ?li schema:lo_custkey ?custkey . ?custkey schema:custcity ?c_city . ?li schema:lo_orderdate ?orderdatekey . ?c_city owl:sameAs ?geo_ccity . ?orderdatekey schema:year ?d_year . ?orderdatekey schema:yearmonth ?d_yearmonth . FILTER(?d_yearmonth = "Dec1997"). ?li schema:lo_revenue ?revenue . ?li schema:lo_suppkey ?suppkey . ?suppkey schema:supcity ?s_city . FILTER(((?c_city = inst:city_UNITEDKI1) || (?c_city = inst:city_UNITEDKI5)) && ((?s_city = inst:city_UNITEDKI9) || (?s_city = inst:city_UNITEDKI5))). ?s_city owl:sameAs ?geo_scity . SERVICE { ?geo_ccity gn:parentFeature ?cust_adm1 . ?geo_scity gn:parentFeature ?sup_adm1 . ?cust_adm1 gn:name ?cust_adm1name . ?sup_adm1 gn:name ?sup_adm1name . } } GROUP BY ?cust_adm1name ?sup_adm1name ?d_year } } UNION { SERVICE { SELECT ?cust_adm1name ?sup_adm1name ?d_year (SUM(?revenue) AS ?sum_revenue) WHERE { ?li schema:lineorder . ?li schema:lo_custkey ?custkey . ?custkey schema:custcity ?c_city . ?li schema:lo_orderdate ?orderdatekey . ?c_city owl:sameAs ?geo_ccity . ?orderdatekey schema:year ?d_year . ?orderdatekey schema:yearmonth ?d_yearmonth . FILTER(?d_yearmonth = "Dec1997"). ?li schema:lo_revenue ?revenue . ?li schema:lo_suppkey ?suppkey_var1 . ?suppkey_var1 schema:valueOf ?suppkey . ?suppkey schema:supcity ?s_city . FILTER(((?c_city = inst:city_UNITEDKI1) || (?c_city = inst:city_UNITEDKI5)) && ((?s_city = inst:city_UNITEDKI9) || (?s_city = inst:city_UNITEDKI5))). ?s_city owl:sameAs ?geo_scity . SERVICE { ?geo_ccity gn:parentFeature ?cust_adm1 . ?geo_scity gn:parentFeature ?sup_adm1 . ?cust_adm1 gn:name ?cust_adm1name . ?sup_adm1 gn:name ?sup_adm1name . } } GROUP BY ?cust_adm1name ?sup_adm1name ?d_year } } UNION { SERVICE { SELECT ?cust_adm1name ?sup_adm1name ?d_year (SUM(?revenue) AS ?sum_revenue) WHERE { ?li schema:lineorder . ?li schema:lo_custkey ?custkey_var1 . ?custkey_var1 schema:valueOf ?custkey . ?custkey schema:custcity ?c_city . ?li schema:lo_orderdate ?orderdatekey . ?c_city owl:sameAs ?geo_ccity . ?orderdatekey schema:year ?d_year . ?orderdatekey schema:yearmonth ?d_yearmonth . FILTER(?d_yearmonth = "Dec1997"). ?li schema:lo_revenue ?revenue . ?li schema:lo_suppkey ?suppkey . ?suppkey schema:supcity ?s_city . FILTER(((?c_city = inst:city_UNITEDKI1) || (?c_city = inst:city_UNITEDKI5)) && ((?s_city = inst:city_UNITEDKI9) || (?s_city = inst:city_UNITEDKI5))). ?s_city owl:sameAs ?geo_scity . SERVICE { ?geo_ccity gn:parentFeature ?cust_adm1 . ?geo_scity gn:parentFeature ?sup_adm1 . ?cust_adm1 gn:name ?cust_adm1name . ?sup_adm1 gn:name ?sup_adm1name . } } GROUP BY ?cust_adm1name ?sup_adm1name ?d_year } } UNION { SERVICE { SELECT ?cust_adm1name ?sup_adm1name ?d_year (SUM(?revenue) AS ?sum_revenue) WHERE { ?li schema:lineorder . ?li schema:lo_custkey ?custkey . ?custkey schema:custcity ?c_city . ?li schema:lo_orderdate ?orderdatekey . ?c_city owl:sameAs ?geo_ccity . ?orderdatekey schema:year ?d_year . ?orderdatekey schema:yearmonth ?d_yearmonth . FILTER(?d_yearmonth = "Dec1997"). ?li schema:lo_revenue ?revenue_var1 . ?revenue_var1 schema:valueOf ?revenue . ?li schema:lo_suppkey ?suppkey . ?suppkey schema:supcity ?s_city . FILTER(((?c_city = inst:city_UNITEDKI1) || (?c_city = inst:city_UNITEDKI5)) && ((?s_city = inst:city_UNITEDKI9) || (?s_city = inst:city_UNITEDKI5))). ?s_city owl:sameAs ?geo_scity . SERVICE { ?geo_ccity gn:parentFeature ?cust_adm1 . ?geo_scity gn:parentFeature ?sup_adm1 . ?cust_adm1 gn:name ?cust_adm1name . ?sup_adm1 gn:name ?sup_adm1name . } } GROUP BY ?cust_adm1name ?sup_adm1name ?d_year } } UNION { SERVICE { SELECT ?cust_adm1name ?sup_adm1name ?d_year (SUM(?revenue) AS ?sum_revenue) WHERE { ?li schema:lineorder . ?li schema:lo_custkey ?custkey . ?custkey schema:custcity ?c_city . ?li schema:lo_orderdate ?orderdatekey_var1 . ?orderdatekey_var1 schema:valueOf ?orderdatekey . ?c_city owl:sameAs ?geo_ccity . ?orderdatekey schema:year ?d_year . ?orderdatekey schema:yearmonth ?d_yearmonth . FILTER(?d_yearmonth = "Dec1997"). ?li schema:lo_revenue ?revenue . ?li schema:lo_suppkey ?suppkey . ?suppkey schema:supcity ?s_city . FILTER(((?c_city = inst:city_UNITEDKI1) || (?c_city = inst:city_UNITEDKI5)) && ((?s_city = inst:city_UNITEDKI9) || (?s_city = inst:city_UNITEDKI5))). ?s_city owl:sameAs ?geo_scity . SERVICE { ?geo_ccity gn:parentFeature ?cust_adm1 . ?geo_scity gn:parentFeature ?sup_adm1 . ?cust_adm1 gn:name ?cust_adm1name . ?sup_adm1 gn:name ?sup_adm1name . } } GROUP BY ?cust_adm1name ?sup_adm1name ?d_year } } } GROUP BY ?cust_adm1name ?sup_adm1name ?d_year ####Q4.1 PREFIX xsd: PREFIX schema: PREFIX inst: PREFIX owl: PREFIX gn: SELECT ?d_year ?cust_regname (SUM(?sum_profit) as ?sum_sum_profit) WHERE { { SERVICE { SELECT ?d_year ?cust_regname (SUM(?revenue - ?supplycost) AS ?sum_profit) WHERE { ?custkey schema:custregion "AMERICA" . ?custkey schema:custcity ?c_city . ?li schema:lo_custkey ?custkey . ?c_city owl:sameAs ?geo_ccity . ?li schema:lineorder . ?li schema:lo_orderdate ?orderdatekey . ?orderdatekey schema:year ?d_year . FILTER(?d_year = 1992 ). ?li schema:lo_partkey ?partkey_var1 . ?partkey_var1 schema:valueOf ?partkey . ?li schema:lo_revenue ?revenue . ?li schema:lo_suppkey ?suppkey . ?li schema:lo_supplycost ?supplycost . ?suppkey schema:supregion "AMERICA" . ?partkey schema:mfgr ?p_mfgr . FILTER((?p_mfgr = "MFGR#1") || (?p_mfgr = "MFGR#2")). ?suppkey schema:supcity ?s_city . ?s_city owl:sameAs ?geo_scity . SERVICE { ?geo_ccity gn:parentCountry ?cust_country . ?cust_country gn:parentFeature ?cust_reg . ?cust_reg gn:name ?cust_regname . } } GROUP BY ?d_year ?cust_regname } } UNION { SERVICE { SELECT ?d_year ?cust_regname (SUM(?revenue - ?supplycost) AS ?sum_profit) WHERE { ?custkey schema:custregion "AMERICA" . ?custkey schema:custcity ?c_city . ?li schema:lo_custkey ?custkey . ?c_city owl:sameAs ?geo_ccity . ?li schema:lineorder . ?li schema:lo_orderdate ?orderdatekey . ?orderdatekey schema:year ?d_year . FILTER(?d_year = 1992 ). ?li schema:lo_partkey ?partkey . ?li schema:lo_revenue ?revenue . ?li schema:lo_suppkey ?suppkey_var1 . ?suppkey_var1 schema:valueOf ?suppkey . ?li schema:lo_supplycost ?supplycost . ?suppkey schema:supregion "AMERICA" . ?partkey schema:mfgr ?p_mfgr . FILTER((?p_mfgr = "MFGR#1") || (?p_mfgr = "MFGR#2")). ?suppkey schema:supcity ?s_city . ?s_city owl:sameAs ?geo_scity . SERVICE { ?geo_ccity gn:parentCountry ?cust_country . ?cust_country gn:parentFeature ?cust_reg . ?cust_reg gn:name ?cust_regname . } } GROUP BY ?d_year ?cust_regname } } UNION { SERVICE { SELECT ?d_year ?cust_regname (SUM(?revenue - ?supplycost) AS ?sum_profit) WHERE { ?custkey schema:custregion "AMERICA" . ?custkey schema:custcity ?c_city . ?li schema:lo_custkey ?custkey_var1 . ?custkey_var1 schema:valueOf ?custkey . ?c_city owl:sameAs ?geo_ccity . ?li schema:lineorder . ?li schema:lo_orderdate ?orderdatekey . ?orderdatekey schema:year ?d_year . FILTER(?d_year = 1992 ). ?li schema:lo_partkey ?partkey . ?li schema:lo_revenue ?revenue . ?li schema:lo_suppkey ?suppkey . ?li schema:lo_supplycost ?supplycost . ?suppkey schema:supregion "AMERICA" . ?partkey schema:mfgr ?p_mfgr . FILTER((?p_mfgr = "MFGR#1") || (?p_mfgr = "MFGR#2")). ?suppkey schema:supcity ?s_city . ?s_city owl:sameAs ?geo_scity . SERVICE { ?geo_ccity gn:parentCountry ?cust_country . ?cust_country gn:parentFeature ?cust_reg . ?cust_reg gn:name ?cust_regname . } } GROUP BY ?d_year ?cust_regname } } UNION { SERVICE { SELECT ?d_year ?cust_regname (SUM(?revenue - ?supplycost) AS ?sum_profit) WHERE { ?custkey schema:custregion "AMERICA" . ?custkey schema:custcity ?c_city . ?li schema:lo_custkey ?custkey . ?c_city owl:sameAs ?geo_ccity . ?li schema:lineorder . ?li schema:lo_orderdate ?orderdatekey . ?orderdatekey schema:year ?d_year . FILTER(?d_year = 1992 ). ?li schema:lo_partkey ?partkey . ?li schema:lo_revenue ?revenue_var1 . ?revenue_var1 schema:valueOf ?revenue . ?li schema:lo_suppkey ?suppkey . ?li schema:lo_supplycost ?supplycost . ?suppkey schema:supregion "AMERICA" . ?partkey schema:mfgr ?p_mfgr . FILTER((?p_mfgr = "MFGR#1") || (?p_mfgr = "MFGR#2")). ?suppkey schema:supcity ?s_city . ?s_city owl:sameAs ?geo_scity . SERVICE { ?geo_ccity gn:parentCountry ?cust_country . ?cust_country gn:parentFeature ?cust_reg . ?cust_reg gn:name ?cust_regname . } } GROUP BY ?d_year ?cust_regname } } UNION { SERVICE { SELECT ?d_year ?cust_regname (SUM(?revenue - ?supplycost) AS ?sum_profit) WHERE { ?custkey schema:custregion "AMERICA" . ?custkey schema:custcity ?c_city . ?li schema:lo_custkey ?custkey . ?c_city owl:sameAs ?geo_ccity . ?li schema:lineorder . ?li schema:lo_orderdate ?orderdatekey_var1 . ?orderdatekey_var1 schema:valueOf ?orderdatekey . ?orderdatekey schema:year ?d_year . FILTER(?d_year = 1992 ). ?li schema:lo_partkey ?partkey . ?li schema:lo_revenue ?revenue . ?li schema:lo_suppkey ?suppkey . ?li schema:lo_supplycost ?supplycost . ?suppkey schema:supregion "AMERICA" . ?partkey schema:mfgr ?p_mfgr . FILTER((?p_mfgr = "MFGR#1") || (?p_mfgr = "MFGR#2")). ?suppkey schema:supcity ?s_city . ?s_city owl:sameAs ?geo_scity . SERVICE { ?geo_ccity gn:parentCountry ?cust_country . ?cust_country gn:parentFeature ?cust_reg . ?cust_reg gn:name ?cust_regname . } } GROUP BY ?d_year ?cust_regname } } } GROUP BY ?d_year ?cust_regname ####Q4.2 PREFIX xsd: PREFIX schema: PREFIX inst: PREFIX owl: PREFIX gn: SELECT ?d_year ?sup_regname ?p_category (SUM(?sum_profit) as ?sum_sum_profit) WHERE { { SERVICE { SELECT ?d_year ?sup_regname ?p_category (SUM(?revenue - ?supplycost) AS ?sum_profit) WHERE { ?custkey schema:custregion "AMERICA" . ?custkey schema:custcity ?c_city . ?li schema:lo_custkey ?custkey . ?c_city owl:sameAs ?geo_ccity . ?li schema:lineorder . ?li schema:lo_orderdate ?orderdatekey . ?orderdatekey schema:year ?d_year . FILTER((?d_year = 1997 ) || (?d_year = 1998 )). ?li schema:lo_partkey ?partkey_var1 . ?partkey_var1 schema:valueOf ?partkey . ?li schema:lo_revenue ?revenue . ?li schema:lo_suppkey ?suppkey . ?li schema:lo_supplycost ?supplycost . ?suppkey schema:supregion "AMERICA" . ?partkey schema:category ?p_category . ?partkey schema:mfgr ?p_mfgr . FILTER((?p_mfgr = "MFGR#1") || (?p_mfgr = "MFGR#2")). ?suppkey schema:supcity ?s_city . ?s_city owl:sameAs ?geo_scity . SERVICE { ?geo_scity gn:parentCountry ?sup_country . ?sup_country gn:parentFeature ?sup_reg . ?sup_reg gn:name ?sup_regname . } } GROUP BY ?d_year ?sup_regname ?p_category } } UNION { SERVICE { SELECT ?d_year ?sup_regname ?p_category (SUM(?revenue - ?supplycost) AS ?sum_profit) WHERE { ?custkey schema:custregion "AMERICA" . ?custkey schema:custcity ?c_city . ?li schema:lo_custkey ?custkey . ?c_city owl:sameAs ?geo_ccity . ?li schema:lineorder . ?li schema:lo_orderdate ?orderdatekey . ?orderdatekey schema:year ?d_year . FILTER((?d_year = 1997 ) || (?d_year = 1998 )). ?li schema:lo_partkey ?partkey . ?li schema:lo_revenue ?revenue . ?li schema:lo_suppkey ?suppkey_var1 . ?suppkey_var1 schema:valueOf ?suppkey . ?li schema:lo_supplycost ?supplycost . ?suppkey schema:supregion "AMERICA" . ?partkey schema:category ?p_category . ?partkey schema:mfgr ?p_mfgr . FILTER((?p_mfgr = "MFGR#1") || (?p_mfgr = "MFGR#2")). ?suppkey schema:supcity ?s_city . ?s_city owl:sameAs ?geo_scity . SERVICE { ?geo_scity gn:parentCountry ?sup_country . ?sup_country gn:parentFeature ?sup_reg . ?sup_reg gn:name ?sup_regname . } } GROUP BY ?d_year ?sup_regname ?p_category } } UNION { SERVICE { SELECT ?d_year ?sup_regname ?p_category (SUM(?revenue - ?supplycost) AS ?sum_profit) WHERE { ?custkey schema:custregion "AMERICA" . ?custkey schema:custcity ?c_city . ?li schema:lo_custkey ?custkey_var1 . ?custkey_var1 schema:valueOf ?custkey . ?c_city owl:sameAs ?geo_ccity . ?li schema:lineorder . ?li schema:lo_orderdate ?orderdatekey . ?orderdatekey schema:year ?d_year . FILTER((?d_year = 1997 ) || (?d_year = 1998 )). ?li schema:lo_partkey ?partkey . ?li schema:lo_revenue ?revenue . ?li schema:lo_suppkey ?suppkey . ?li schema:lo_supplycost ?supplycost . ?suppkey schema:supregion "AMERICA" . ?partkey schema:category ?p_category . ?partkey schema:mfgr ?p_mfgr . FILTER((?p_mfgr = "MFGR#1") || (?p_mfgr = "MFGR#2")). ?suppkey schema:supcity ?s_city . ?s_city owl:sameAs ?geo_scity . SERVICE { ?geo_scity gn:parentCountry ?sup_country . ?sup_country gn:parentFeature ?sup_reg . ?sup_reg gn:name ?sup_regname . } } GROUP BY ?d_year ?sup_regname ?p_category } } UNION { SERVICE { SELECT ?d_year ?sup_regname ?p_category (SUM(?revenue - ?supplycost) AS ?sum_profit) WHERE { ?custkey schema:custregion "AMERICA" . ?custkey schema:custcity ?c_city . ?li schema:lo_custkey ?custkey . ?c_city owl:sameAs ?geo_ccity . ?li schema:lineorder . ?li schema:lo_orderdate ?orderdatekey . ?orderdatekey schema:year ?d_year . FILTER((?d_year = 1997 ) || (?d_year = 1998 )). ?li schema:lo_partkey ?partkey . ?li schema:lo_revenue ?revenue_var1 . ?revenue_var1 schema:valueOf ?revenue . ?li schema:lo_suppkey ?suppkey . ?li schema:lo_supplycost ?supplycost . ?suppkey schema:supregion "AMERICA" . ?partkey schema:category ?p_category . ?partkey schema:mfgr ?p_mfgr . FILTER((?p_mfgr = "MFGR#1") || (?p_mfgr = "MFGR#2")). ?suppkey schema:supcity ?s_city . ?s_city owl:sameAs ?geo_scity . SERVICE { ?geo_scity gn:parentCountry ?sup_country . ?sup_country gn:parentFeature ?sup_reg . ?sup_reg gn:name ?sup_regname . } } GROUP BY ?d_year ?sup_regname ?p_category } } UNION { SERVICE { SELECT ?d_year ?sup_regname ?p_category (SUM(?revenue - ?supplycost) AS ?sum_profit) WHERE { ?custkey schema:custregion "AMERICA" . ?custkey schema:custcity ?c_city . ?li schema:lo_custkey ?custkey . ?c_city owl:sameAs ?geo_ccity . ?li schema:lineorder . ?li schema:lo_orderdate ?orderdatekey_var1 . ?orderdatekey_var1 schema:valueOf ?orderdatekey . ?orderdatekey schema:year ?d_year . FILTER((?d_year = 1997 ) || (?d_year = 1998 )). ?li schema:lo_partkey ?partkey . ?li schema:lo_revenue ?revenue . ?li schema:lo_suppkey ?suppkey . ?li schema:lo_supplycost ?supplycost . ?suppkey schema:supregion "AMERICA" . ?partkey schema:category ?p_category . ?partkey schema:mfgr ?p_mfgr . FILTER((?p_mfgr = "MFGR#1") || (?p_mfgr = "MFGR#2")). ?suppkey schema:supcity ?s_city . ?s_city owl:sameAs ?geo_scity . SERVICE { ?geo_scity gn:parentCountry ?sup_country . ?sup_country gn:parentFeature ?sup_reg . ?sup_reg gn:name ?sup_regname . } } GROUP BY ?d_year ?sup_regname ?p_category } } } GROUP BY ?d_year ?sup_regname ?p_category ####Q4.3 PREFIX xsd: PREFIX schema: PREFIX inst: PREFIX owl: PREFIX gn: SELECT ?d_year ?sup_adm1name ?p_brand1 (SUM(?sum_profit) as ?sum_sum_profit) WHERE { { SERVICE { SELECT ?d_year ?sup_adm1name ?p_brand1 (SUM(?revenue - ?supplycost) AS ?sum_profit) WHERE { ?custkey schema:custregion "AMERICA" . ?custkey schema:custcity ?c_city . ?li schema:lo_custkey ?custkey . ?li schema:lineorder . ?c_city owl:sameAs ?geo_ccity . ?li schema:lo_orderdate ?orderdatekey . ?orderdatekey schema:year ?d_year . FILTER((?d_year = 1997 ) || (?d_year = 1998 )). ?li schema:lo_partkey ?partkey_var1 . ?partkey_var1 schema:valueOf ?partkey . ?li schema:lo_revenue ?revenue . ?li schema:lo_suppkey ?suppkey . ?li schema:lo_supplycost ?supplycost . ?partkey schema:category "MFGR#14" . ?partkey schema:brand1 ?p_brand1 . ?suppkey schema:supcity ?s_city . ?suppkey schema:supnation ?supnation . ?supnation schema:countryname "UNITED_STATES" . ?s_city owl:sameAs ?geo_scity . SERVICE { ?geo_scity gn:parentFeature ?sup_adm1 . ?sup_adm1 gn:name ?sup_adm1name . } } GROUP BY ?d_year ?sup_adm1name ?p_brand1 } } UNION { SERVICE { SELECT ?d_year ?sup_adm1name ?p_brand1 (SUM(?revenue - ?supplycost) AS ?sum_profit) WHERE { ?custkey schema:custregion "AMERICA" . ?custkey schema:custcity ?c_city . ?li schema:lo_custkey ?custkey . ?li schema:lineorder . ?c_city owl:sameAs ?geo_ccity . ?li schema:lo_orderdate ?orderdatekey . ?orderdatekey schema:year ?d_year . FILTER((?d_year = 1997 ) || (?d_year = 1998 )). ?li schema:lo_partkey ?partkey . ?li schema:lo_revenue ?revenue . ?li schema:lo_suppkey ?suppkey_var1 . ?suppkey_var1 schema:valueOf ?suppkey . ?li schema:lo_supplycost ?supplycost . ?partkey schema:category "MFGR#14" . ?partkey schema:brand1 ?p_brand1 . ?suppkey schema:supcity ?s_city . ?suppkey schema:supnation ?supnation . ?supnation schema:countryname "UNITED_STATES" . ?s_city owl:sameAs ?geo_scity . SERVICE { ?geo_scity gn:parentFeature ?sup_adm1 . ?sup_adm1 gn:name ?sup_adm1name . } } GROUP BY ?d_year ?sup_adm1name ?p_brand1 } } UNION { SERVICE { SELECT ?d_year ?sup_adm1name ?p_brand1 (SUM(?revenue - ?supplycost) AS ?sum_profit) WHERE { ?custkey schema:custregion "AMERICA" . ?custkey schema:custcity ?c_city . ?li schema:lo_custkey ?custkey_var1 . ?custkey_var1 schema:valueOf ?custkey . ?li schema:lineorder . ?c_city owl:sameAs ?geo_ccity . ?li schema:lo_orderdate ?orderdatekey . ?orderdatekey schema:year ?d_year . FILTER((?d_year = 1997 ) || (?d_year = 1998 )). ?li schema:lo_partkey ?partkey . ?li schema:lo_revenue ?revenue . ?li schema:lo_suppkey ?suppkey . ?li schema:lo_supplycost ?supplycost . ?partkey schema:category "MFGR#14" . ?partkey schema:brand1 ?p_brand1 . ?suppkey schema:supcity ?s_city . ?suppkey schema:supnation ?supnation . ?supnation schema:countryname "UNITED_STATES" . ?s_city owl:sameAs ?geo_scity . SERVICE { ?geo_scity gn:parentFeature ?sup_adm1 . ?sup_adm1 gn:name ?sup_adm1name . } } GROUP BY ?d_year ?sup_adm1name ?p_brand1 } } UNION { SERVICE { SELECT ?d_year ?sup_adm1name ?p_brand1 (SUM(?revenue - ?supplycost) AS ?sum_profit) WHERE { ?custkey schema:custregion "AMERICA" . ?custkey schema:custcity ?c_city . ?li schema:lo_custkey ?custkey . ?li schema:lineorder . ?c_city owl:sameAs ?geo_ccity . ?li schema:lo_orderdate ?orderdatekey . ?orderdatekey schema:year ?d_year . FILTER((?d_year = 1997 ) || (?d_year = 1998 )). ?li schema:lo_partkey ?partkey . ?li schema:lo_revenue ?revenue_var1 . ?revenue_var1 schema:valueOf ?revenue . ?li schema:lo_suppkey ?suppkey . ?li schema:lo_supplycost ?supplycost . ?partkey schema:category "MFGR#14" . ?partkey schema:brand1 ?p_brand1 . ?suppkey schema:supcity ?s_city . ?suppkey schema:supnation ?supnation . ?supnation schema:countryname "UNITED_STATES" . ?s_city owl:sameAs ?geo_scity . SERVICE { ?geo_scity gn:parentFeature ?sup_adm1 . ?sup_adm1 gn:name ?sup_adm1name . } } GROUP BY ?d_year ?sup_adm1name ?p_brand1 } } UNION { SERVICE { SELECT ?d_year ?sup_adm1name ?p_brand1 (SUM(?revenue - ?supplycost) AS ?sum_profit) WHERE { ?custkey schema:custregion "AMERICA" . ?custkey schema:custcity ?c_city . ?li schema:lo_custkey ?custkey . ?li schema:lineorder . ?c_city owl:sameAs ?geo_ccity . ?li schema:lo_orderdate ?orderdatekey_var1 . ?orderdatekey_var1 schema:valueOf ?orderdatekey . ?orderdatekey schema:year ?d_year . FILTER((?d_year = 1997 ) || (?d_year = 1998 )). ?li schema:lo_partkey ?partkey . ?li schema:lo_revenue ?revenue . ?li schema:lo_suppkey ?suppkey . ?li schema:lo_supplycost ?supplycost . ?partkey schema:category "MFGR#14" . ?partkey schema:brand1 ?p_brand1 . ?suppkey schema:supcity ?s_city . ?suppkey schema:supnation ?supnation . ?supnation schema:countryname "UNITED_STATES" . ?s_city owl:sameAs ?geo_scity . SERVICE { ?geo_scity gn:parentFeature ?sup_adm1 . ?sup_adm1 gn:name ?sup_adm1name . } } GROUP BY ?d_year ?sup_adm1name ?p_brand1 } } } GROUP BY ?d_year ?sup_adm1name ?p_brand1