English 中文(简体)
Using DBpedia for book search
原标题:

I want to write code to query DBpedia and search for book information like author, book title, etc..

What is the prefix and which Named Graph should I use to build this SPARQL query?

问题回答

an example query could look like this:

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX dbpedia: <http://dbpedia.org/resource/>
PREFIX ontology: <http://dbpedia.org/ontology/>

select distinct ?s  ?author 
where {
?s rdf:type ontology:Book;
  ontology:author ?author .
}

you can test it on http://dbpedia.org/sparql and the default graph is http://dbpedia.org

you might also need to take a look at http://mappings.dbpedia.org/server/ontology/classes/Book for the book class properties





相关问题
SPARQL xsd:dateTime equality

I have a SPARQL query: PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX person: <http://www.myOntDomain/person#> PREFIX likedEvent: <http://www.myOntDomain/likedEventRule#...

SPARQL queries for Pizza ontology

i have to use ROWLKit http://www.dis.uniroma1.it/quonto/?q=node/30 (1) can anybody suggest two sparql queries for the Pizza.owl ? (2) is this query valid ? PREFIX rdf: <http://www.w3.org/1999/02/...

Usage of MongoDB as a RDFStore for data objects

Is there any tool to query MongoDB using SPARQL ? I store object using an RDF schema (boo Mongo no schema ^^), and now i looking for a tool/server to query the datastore using SPARQL. I started to ...

SPARQL query language tag weirdness

This works: SELECT * WHERE{ ?x rdfs:label "Chalti Ka Naam Gaadi"@en . ?x foaf:name ?z . } (Results on DBpedia SPARQL Explorer) This doesn t: SELECT * WHERE{ ?x foaf:name "Chalti Ka Naam Gaadi" ...

Question on RDF and how thisweknow.org works

I was reading through this question What s a RDF triple? and the excellent answers to it. Roger Federer | won | wimbledon I understand that the above sentence is a triplet. But if the ...

Defining cardinality for a RDF statement

Im having a problem with RDF. I have a couple of triples defined as : <User rdf:about="#T"> <hasName rdf:datatype="http://www.w3.org/2001/XMLSchema#string">T</hasName> <...

Pick and RDF/SPARQL

Anyone have any interest in intergrating RDF and/or SPARQL with a PICK database? Has anyone tried this yet? I have some thoughts about what to try. One idea is to figure out how to create a file with ...

Problem with SPARQLWrapper (Python)

I m making a SPARQL query against the Sesame store in localhost, using SPARQLWrapper: sparql = SPARQLWrapper( http://localhost:8080/openrdf-sesame/repositories/rep/statements ) sparql.setQuery(...

热门标签