xquery version "1.0"; declare namespace r = "http://www.w3.org/2005/sparql-results#"; declare option exist:serialize "method=xhtml media-type=text/html"; (: sparql query to get the capital for each country :) declare variable $query := " PREFIX rdf: PREFIX mon: SELECT distinct ?name ?population WHERE { ?country rdf:type mon:Country ; mon:name ?name ; mon:population ?population. ?capital mon:name ?cname. }"; (: set up target for query - note the xml entity in the querystring :) declare function local:execute-sparql($query as xs:string) { let $sparql := concat("http://localhost:8080/openrdf-workbench/repositories/Benjamin-mondial/query?format=xml&query=",escape-uri($query, true())) return doc($sparql) }; (: return html :) European Country Population

European Country Population

{ for $tuple in local:execute-sparql($query)//r:result let $name := $tuple/r:binding[@name="name"]/r:literal let $population := $tuple/r:binding[@name="population"]/r:literal return }
NAME POPULATION
{$name} {$population}
================================================================= xquery version "1.0"; declare namespace r = "http://www.w3.org/2005/sparql-results#"; declare option exist:serialize "method=xhtml media-type=text/html"; (: sparql query to get the capital for each country :) declare variable $query := " PREFIX rdf: PREFIX mon: SELECT ?name ?area WHERE { ?country rdf:type mon:Country ; mon:name ?name ; mon:area ?area; }"; (: set up target for query - note the xml entity in the querystring :) declare function local:execute-sparql($query as xs:string) { let $sparql := concat("http://localhost:8080/openrdf-workbench/repositories/Benjamin-mondial/query?format=xml&query=",escape-uri($query, true())) return doc($sparql) }; (: return html :) European Country Area

European Country Area

{ for $tuple in local:execute-sparql($query)//r:result let $name := $tuple/r:binding[@name="name"]/r:literal let $area := $tuple/r:binding[@name="area"]/r:literal return }
NAME AREA
{$name} {$area}
================================================================= xquery version "1.0"; declare namespace r = "http://www.w3.org/2005/sparql-results#"; declare option exist:serialize "method=xhtml media-type=text/html"; (: sparql query to get the capital for each country :) declare variable $query := " PREFIX mon: PREFIX rdf: PREFIX rdfs: PREFIX owl11: PREFIX xsd: PREFIX owl: PREFIX dbpprop: SELECT ?name ?drivesOn WHERE { ?country rdf:type mon:Country; mon:name ?name. ?x dbpprop:commonName ?cname; dbpprop:drivesOn ?drivesOn. Filter (?name=?cname). }"; (: set up target for query - note the xml entity in the querystring :) declare function local:execute-sparql($query as xs:string) { let $sparql := concat("http://localhost:8080/openrdf-workbench/repositories/Benjamin-mondial/query?format=xml&query=",escape-uri($query, true())) return doc($sparql) }; (: return html :) European Country - Road side to Drive On

European Country - Road side to Drive On

{ for $tuple in local:execute-sparql($query)//r:result let $name := $tuple/r:binding[@name="name"]/r:literal let $drivesOn := $tuple/r:binding[@name="drivesOn"]/r:literal return }
NAME Drive On
{$name} {$drivesOn}
================================================================= xquery version "1.0"; declare namespace r = "http://www.w3.org/2005/sparql-results#"; declare option exist:serialize "method=xhtml media-type=text/html"; (: sparql query to get the capital for each country :) declare variable $query := " PREFIX mon: PREFIX rdf: PREFIX rdfs: PREFIX owl11: PREFIX xsd: PREFIX owl: PREFIX dbpprop: SELECT ?name ?census WHERE { ?country rdf:type mon:Country; mon:name ?name. ?x dbpprop:commonName ?cname; dbpprop:populationCensus ?census. Filter (?name=?cname). }"; (: set up target for query - note the xml entity in the querystring :) declare function local:execute-sparql($query as xs:string) { let $sparql := concat("http://localhost:8080/openrdf-workbench/repositories/Benjamin-mondial/query?format=xml&query=",escape-uri($query, true())) return doc($sparql) }; (: return html :) European Country census

European Country census

{ for $tuple in local:execute-sparql($query)//r:result let $name := $tuple/r:binding[@name="name"]/r:literal let $census := $tuple/r:binding[@name="census"]/r:literal return }
NAME census
{$name} {$census}
================================================================= xquery version "1.0"; declare namespace r = "http://www.w3.org/2005/sparql-results#"; declare option exist:serialize "method=xhtml media-type=text/html"; (: sparql query to get the capital for each country :) declare variable $query := " PREFIX mon: PREFIX rdf: PREFIX rdfs: PREFIX owl11: PREFIX xsd: PREFIX owl: PREFIX dbpprop: SELECT ?name ?legislature WHERE { ?country rdf:type mon:Country; mon:name ?name. ?x dbpprop:commonName ?cname; dbpprop:legislature ?legislature. Filter (?name=?cname). }"; (: set up target for query - note the xml entity in the querystring :) declare function local:execute-sparql($query as xs:string) { let $sparql := concat("http://localhost:8080/openrdf-workbench/repositories/Benjamin-mondial/query?format=xml&query=",escape-uri($query, true())) return doc($sparql) }; (: return html :) European Country - Legislature

European Country - Legislature

{ for $tuple in local:execute-sparql($query)//r:result let $name := $tuple/r:binding[@name="name"]/r:literal let $legislature := $tuple/r:binding[@name="legislature"]/r:literal return }
NAME Legislature
{$name} {$legislature}