<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="/isparql/xslt/dynamic-page.xsl"?><iSPARQL xmlns="urn:schemas-openlink-com:isparql"><ISparqlDynamicPage><proxy>true</proxy><query><![CDATA[#service:/sparql
#should-sponge:soft

define sql:signal-void-variables 1
prefix tpch: <http://www.openlinksw.com/schemas/tpch#>
prefix oplsioc: <http://www.openlinksw.com/schemas/oplsioc#>
prefix sioc: <http://rdfs.org/sioc/ns#>
prefix foaf: <http://xmlns.com/foaf/0.1/>
select ?supp_nation ?cust_nation ?li_year
  sum (?value) as ?revenue
from <http://demo.openlinksw.com/tpch>
where {
    {
      select
        ?suppn+>tpch:name as ?supp_nation,
        ?custn+>tpch:name as ?cust_nation,
        (bif:year (?li+>tpch:shipdate)) as ?li_year,
        (?li+>tpch:lineextendedprice * (1 - ?li+>tpch:linediscount)) as ?value
      where {
          ?li a tpch:lineitem ; tpch:has_order ?ord ; tpch:has_supplier ?supp .
          ?ord tpch:has_customer ?cust .
          ?cust tpch:has_nation ?custn .
          ?supp tpch:has_nation ?suppn .
          filter ((
              (?custn+>tpch:name = "http://dbpedia.org/resource/France"
          and ?suppn+>tpch:name = "http://dbpedia.org/resource/Germany") ||
              (?custn+>tpch:name = "http://dbpedia.org/resource/Germany"
          and ?suppn+>tpch:name = "http://dbpedia.org/resource/France") ) &&
            (?li+>tpch:shipdate >= "1995-01-01"^^xsd:date) &&
            (?li+>tpch:shipdate <= "1996-12-31"^^xsd:date) ) } } }
order by
  ?supp_nation
  ?li_year
]]></query><graph>http://demo.openlinksw.com/tpch</graph></ISparqlDynamicPage><should_sponge>soft</should_sponge><service>/sparql</service></iSPARQL>