From: Olaf H. <ha...@in...> - 2010-12-15 15:13:51
|
Hey Fahad, The problem is that the FOAF vocabulary definition that is available by looking up the URI foaf:Document, does not include links to the definition of your vocabulary. To solve this problem for your application, you can make up such links and load them into SWClLib before you execute your queries. So, what you have to do is to create an RDF document locally and add RDF triples such as: foaf:Document rdfs:seeAlso <http://localhost:8080/newspaper/vocabulary/news/> You load this file as seed data into the queried dataset used by SWClLib. This can be done as follows: 1.) if you use the command line client ./bin/semwebquery you can use the parameter -load You only have to provide a file:// URI for you RDF document. So, you could do something like: ./bin/semwebquery -load file:///home/user/data/mylinks.rdf -sparqlfile query.rq 2.) if you use the library in a Java program you have to create a de.fuberlin.wiwiss.ng4j.NamedGraph object that contains the RDF triples from your document and add this NamedGraph to your SemanticWebClient object using the method addGraph Greetings, Olaf On Wednesday 15 December 2010 13:48:22 Fahad Alahmari wrote: > Hi, > > I'm trying to use the Semantic Web Client Library to query my own datasets > that stored in a control environment. I used Pubby to translate the orginal > URIs to my environment URIs to run the SPARQL queries over datasets easily. > SWCILib runs queries that included my environment URIs properly but can not > run queries that do not have my environment URIs. For example: > > This query run properly: > > PREFIX news: <http://localhost:8080/newspaper/vocabulary/news/> > SELECT ?s ?p WHERE { ?s ?p news:article } > > > But with this query, SWCILib can not point URIs to things in my own > environment: > > PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> > PREFIX foaf: <http://xmlns.com/foaf/0.1/> > SELECT ?s ?p WHERE { ?class rdfs:subClassOf foaf:Document } > > > How can I re-direct the following URIs to my local datasets to run queries > over them? > > PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> > PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> > PREFIX foaf: <http://xmlns.com/foaf/0.1/> > PREFIX dc: <http://purl.org/dc/elements/1.1/> > PREFIX dcterms: <http://purl.org/dc/terms/> > > Is Pubby able to map all the above URIs? If not so, is there any other > server you advise to use instead of Pubby? > > I appreciate any help in advance > > Regards, > Fahad |