dbpedia - SPARQL Federated Queries - Using uri returned from a query in another query -


in below query want use ?uri variable identifies dbpedia resource obtain dbpedia element dbpedia sparql service, returns no result expects uri within <>.

i tried <?uri> again no results had returned. when write uri directly, returns desired results, couldn't manage using variable.

prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> prefix lit: <http://purl.org/net/cnyt-literature#>  select distinct ?writer ?play ?character ?uri ?type  {     {         ?writer lit:writerof ?play .         ?play lit:character ?character .         ?character lit:dbpediauri ?uri     }      service <http://dbpedia.org/sparql> {         ?uri rdf:type ?type     }    } limit 50 

here result of query service part ommitted :

enter image description here

when replace ?uri in service part "http://dbpedia.org/resource/julius_caesar", fetches information dbpedia don't know how using ?uri variable.

here owl file :

<?xml version="1.0"?> <rdf:rdf xmlns="http://purl.org/net/cnyt-literature#"      xml:base="http://purl.org/net/cnyt-literature"      xmlns:literature="http://purl.org/net/cnyt-literature#"      xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"      xmlns:owl="http://www.w3.org/2002/07/owl#"      xmlns:xml="http://www.w3.org/xml/1998/namespace"      xmlns:xsd="http://www.w3.org/2001/xmlschema#"      xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">     <owl:ontology rdf:about="http://purl.org/net/cnyt-literature"/>     <!--       //     // object properties     //      <!-- http://purl.org/net/cnyt-literature#character -->      <owl:objectproperty rdf:about="http://purl.org/net/cnyt-literature#character">         <rdfs:domain rdf:resource="http://www.semanticweb.org/cnytync/ontologies/2017/6/literature#play"/>         <rdfs:range rdf:resource="http://www.semanticweb.org/cnytync/ontologies/2017/6/literature#human"/>     </owl:objectproperty>      <!-- http://purl.org/net/cnyt-literature#writerof -->      <owl:objectproperty rdf:about="http://purl.org/net/cnyt-literature#writerof">         <rdfs:domain rdf:resource="http://www.semanticweb.org/cnytync/ontologies/2017/6/literature#writer"/>         <rdfs:range rdf:resource="http://www.semanticweb.org/cnytync/ontologies/2017/6/literature#play"/>     </owl:objectproperty>      <!-- http://www.w3.org/2002/07/owl#sameas -->      <owl:objectproperty rdf:about="http://www.w3.org/2002/07/owl#sameas">         <rdfs:domain rdf:resource="http://www.w3.org/2002/07/owl#thing"/>         <rdfs:range rdf:resource="http://www.w3.org/2002/07/owl#thing"/>     </owl:objectproperty>     <!--       //     // data properties     //      <!-- http://purl.org/net/cnyt-literature#dbpediauri -->      <owl:datatypeproperty rdf:about="http://purl.org/net/cnyt-literature#dbpediauri">         <rdfs:subpropertyof rdf:resource="http://www.w3.org/2002/07/owl#topdataproperty"/>     </owl:datatypeproperty>      <!-- http://purl.org/net/cnyt-literature#name -->      <owl:datatypeproperty rdf:about="http://purl.org/net/cnyt-literature#name">         <rdfs:domain rdf:resource="http://www.semanticweb.org/cnytync/ontologies/2017/6/literature#human"/>         <rdfs:domain rdf:resource="http://www.semanticweb.org/cnytync/ontologies/2017/6/literature#literary_work"/>         <rdfs:domain rdf:resource="http://www.semanticweb.org/cnytync/ontologies/2017/6/literature#politician"/>         <rdfs:domain rdf:resource="http://www.semanticweb.org/cnytync/ontologies/2017/6/literature#writer"/>         <rdfs:range rdf:resource="http://www.w3.org/2001/xmlschema#string"/>     </owl:datatypeproperty>       <!-- http://purl.org/net/cnyt-literature#source -->      <owl:datatypeproperty rdf:about="http://purl.org/net/cnyt-literature#source"/>      <!-- http://purl.org/net/cnyt-literature#wikidatauri -->      <owl:datatypeproperty rdf:about="http://purl.org/net/cnyt-literature#wikidatauri"/>      <!-- http://www.semanticweb.org/cnytync/ontologies/2017/6/literature#uri -->      <owl:datatypeproperty rdf:about="http://www.semanticweb.org/cnytync/ontologies/2017/6/literature#uri"/>      <!-- http://www.w3.org/2002/07/owl#sameas -->      <owl:datatypeproperty rdf:about="http://www.w3.org/2002/07/owl#sameas"/>      //     // classes     //      <!-- http://purl.org/net/cnyt-literature#novel -->      <owl:class rdf:about="http://purl.org/net/cnyt-literature#novel">         <rdfs:subclassof rdf:resource="http://www.semanticweb.org/cnytync/ontologies/2017/6/literature#literary_work"/>     </owl:class>     <!-- http://www.semanticweb.org/cnytync/ontologies/2017/6/literature#externalitem -->      <owl:class rdf:about="http://www.semanticweb.org/cnytync/ontologies/2017/6/literature#externalitem"/>      <!-- http://www.semanticweb.org/cnytync/ontologies/2017/6/literature#human -->      <owl:class rdf:about="http://www.semanticweb.org/cnytync/ontologies/2017/6/literature#human"/>     <!-- http://www.semanticweb.org/cnytync/ontologies/2017/6/literature#literary_work -->      <owl:class rdf:about="http://www.semanticweb.org/cnytync/ontologies/2017/6/literature#literary_work"/>      <!-- http://www.semanticweb.org/cnytync/ontologies/2017/6/literature#play -->      <owl:class rdf:about="http://www.semanticweb.org/cnytync/ontologies/2017/6/literature#play">         <rdfs:subclassof rdf:resource="http://www.semanticweb.org/cnytync/ontologies/2017/6/literature#literary_work"/>     </owl:class>        <!-- http://www.semanticweb.org/cnytync/ontologies/2017/6/literature#politician -->      <owl:class rdf:about="http://www.semanticweb.org/cnytync/ontologies/2017/6/literature#politician">         <rdfs:subclassof rdf:resource="http://www.semanticweb.org/cnytync/ontologies/2017/6/literature#human"/>     </owl:class>      <!-- http://www.semanticweb.org/cnytync/ontologies/2017/6/literature#writer -->      <owl:class rdf:about="http://www.semanticweb.org/cnytync/ontologies/2017/6/literature#writer">         <rdfs:subclassof rdf:resource="http://www.semanticweb.org/cnytync/ontologies/2017/6/literature#human"/>     </owl:class>        //     // individuals     //      <!-- http://purl.org/net/cnyt-literature#jacklondon -->      <owl:namedindividual rdf:about="http://purl.org/net/cnyt-literature#jacklondon">         <rdf:type rdf:resource="http://www.semanticweb.org/cnytync/ontologies/2017/6/literature#writer"/>         <writerof rdf:resource="http://purl.org/net/cnyt-literature#whitefang"/>         <name rdf:datatype="http://www.w3.org/2001/xmlschema#string">jack london</name>     </owl:namedindividual>      <!-- http://purl.org/net/cnyt-literature#juliuscaesar -->      <owl:namedindividual rdf:about="http://purl.org/net/cnyt-literature#juliuscaesar">         <rdf:type rdf:resource="http://www.semanticweb.org/cnytync/ontologies/2017/6/literature#politician"/>         <dbpediauri rdf:datatype="http://www.w3.org/2001/xmlschema#string">http://dbpedia.org/resource/julius_caesar</dbpediauri>         <wikidatauri rdf:datatype="http://www.w3.org/2001/xmlschema#string">https://www.wikidata.org/wiki/q1048</wikidatauri>         <owl:sameas rdf:datatype="http://www.w3.org/2001/xmlschema#string">http://dbpedia.org/resource/julius_caesar</owl:sameas>         <owl:sameas rdf:datatype="http://www.w3.org/2001/xmlschema#string">https://www.wikidata.org/wiki/q1048</owl:sameas>     </owl:namedindividual>      <!-- http://purl.org/net/cnyt-literature#juliuscaesardbpedia -->      <owl:namedindividual rdf:about="http://purl.org/net/cnyt-literature#juliuscaesardbpedia">         <rdf:type rdf:resource="http://www.semanticweb.org/cnytync/ontologies/2017/6/literature#externalitem"/>         <source rdf:datatype="http://www.w3.org/2001/xmlschema#string">dbpedia</source>         <literature1:uri rdf:datatype="http://www.w3.org/2001/xmlschema#string">http://dbpedia.org/page/julius_caesar</literature1:uri>     </owl:namedindividual>       <!-- http://purl.org/net/cnyt-literature#juliuscaesarplaydbpedia -->      <owl:namedindividual rdf:about="http://purl.org/net/cnyt-literature#juliuscaesarplaydbpedia">         <rdf:type rdf:resource="http://www.semanticweb.org/cnytync/ontologies/2017/6/literature#externalitem"/>         <source rdf:datatype="http://www.w3.org/2001/xmlschema#string">dbpedia</source>         <literature1:uri rdf:datatype="http://www.w3.org/2001/xmlschema#string">http://dbpedia.org/resource/julius_caesar_(play)</literature1:uri>     </owl:namedindividual>     <!-- http://purl.org/net/cnyt-literature#juliuscaesarplaywikidata -->      <owl:namedindividual rdf:about="http://purl.org/net/cnyt-literature#juliuscaesarplaywikidata">         <rdf:type rdf:resource="http://www.semanticweb.org/cnytync/ontologies/2017/6/literature#externalitem"/>         <source rdf:datatype="http://www.w3.org/2001/xmlschema#string">wikidata</source>         <literature1:uri rdf:datatype="http://www.w3.org/2001/xmlschema#string">https://www.wikidata.org/wiki/q215750</literature1:uri>     </owl:namedindividual>      <!-- http://purl.org/net/cnyt-literature#juliuscaesarwikidata -->      <owl:namedindividual rdf:about="http://purl.org/net/cnyt-literature#juliuscaesarwikidata">         <rdf:type rdf:resource="http://www.semanticweb.org/cnytync/ontologies/2017/6/literature#externalitem"/>         <source rdf:datatype="http://www.w3.org/2001/xmlschema#string">wikidata</source>         <literature1:uri rdf:datatype="http://www.w3.org/2001/xmlschema#string">https://www.wikidata.org/wiki/q1048</literature1:uri>     </owl:namedindividual>     <!-- http://purl.org/net/cnyt-literature#whitefang -->      <owl:namedindividual rdf:about="http://purl.org/net/cnyt-literature#whitefang">         <rdf:type rdf:resource="http://purl.org/net/cnyt-literature#novel"/>     </owl:namedindividual>        <!-- http://purl.org/net/cnyt-literature#williamshakespearedbpedia -->      <owl:namedindividual rdf:about="http://purl.org/net/cnyt-literature#williamshakespearedbpedia">         <rdf:type rdf:resource="http://www.semanticweb.org/cnytync/ontologies/2017/6/literature#externalitem"/>         <source rdf:datatype="http://www.w3.org/2001/xmlschema#string">dbpedia</source>         <literature1:uri rdf:datatype="http://www.w3.org/2001/xmlschema#string">dbpedia.org/page/william_shakespeare</literature1:uri>     </owl:namedindividual>      <!-- http://purl.org/net/cnyt-literature#williamshakespearewikidata -->      <owl:namedindividual rdf:about="http://purl.org/net/cnyt-literature#williamshakespearewikidata">         <rdf:type rdf:resource="http://www.semanticweb.org/cnytync/ontologies/2017/6/literature#externalitem"/>         <source rdf:datatype="http://www.w3.org/2001/xmlschema#string">wikidata</source>         <literature1:uri rdf:datatype="http://www.w3.org/2001/xmlschema#string">https://www.wikidata.org/wiki/q692</literature1:uri>     </owl:namedindividual>       <!-- http://www.semanticweb.org/cnytync/ontologies/2017/6/literature#juliuscaesarplay -->      <owl:namedindividual rdf:about="http://www.semanticweb.org/cnytync/ontologies/2017/6/literature#juliuscaesarplay">         <rdf:type rdf:resource="http://www.semanticweb.org/cnytync/ontologies/2017/6/literature#play"/>         <character rdf:resource="http://purl.org/net/cnyt-literature#juliuscaesar"/>         <dbpediauri rdf:datatype="http://www.w3.org/2001/xmlschema#string">http://dbpedia.org/page/julius_caesar_(play)</dbpediauri>         <wikidatauri rdf:datatype="http://www.w3.org/2001/xmlschema#string">https://www.wikidata.org/wiki/q1048</wikidatauri>         <owl:sameas rdf:datatype="http://www.w3.org/2001/xmlschema#string">http://dbpedia.org/page/julius_caesar_(play)</owl:sameas>         <owl:sameas rdf:datatype="http://www.w3.org/2001/xmlschema#string">https://www.wikidata.org/wiki/q1048</owl:sameas>     </owl:namedindividual>        <!-- http://www.semanticweb.org/cnytync/ontologies/2017/6/literature#williamshakespeare -->      <owl:namedindividual rdf:about="http://www.semanticweb.org/cnytync/ontologies/2017/6/literature#williamshakespeare">         <rdf:type rdf:resource="http://www.semanticweb.org/cnytync/ontologies/2017/6/literature#writer"/>         <writerof rdf:resource="http://www.semanticweb.org/cnytync/ontologies/2017/6/literature#juliuscaesarplay"/>         <dbpediauri rdf:datatype="http://www.w3.org/2001/xmlschema#string">http://dbpedia.org/page/william_shakespeare</dbpediauri>         <wikidatauri rdf:datatype="http://www.w3.org/2001/xmlschema#string">https://www.wikidata.org/wiki/q692</wikidatauri>         <owl:sameas rdf:datatype="http://www.w3.org/2001/xmlschema#string">http://dbpedia.org/page/william_shakespeare</owl:sameas>         <owl:sameas rdf:datatype="http://www.w3.org/2001/xmlschema#string">https://www.wikidata.org/wiki/q692</owl:sameas>     </owl:namedindividual> </rdf:rdf>    <!-- generated owl api (version 4.2.6.20160910-2108) https://github.com/owlcs/owlapi --> 


Comments

Popular posts from this blog

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -