coder
coder

Reputation: 13

SPARQL query against DBPedia to get all property-value of the item

I am a novice in Semantic Web and I would like to retrieve all property-value pairs of "apple" from DBPedia using SPARQL query. Below I have written the query in http://dbpedia.org/sparql editor, but it returns no any results.Could you tell me where I make a mistake, please?

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
prefix dbo: <http://dbpedia.org/ontology/>
prefix owl: <http://www.w3.org/2002/07/owl#>
prefix prov: <http://www.w3.org/ns/prov#>
prefix foaf: <http://xmlns.com/foaf/0.1/>
prefix dbp: <http://dbpedia.org/property/>
prefix dct: <http://purl.org/dc/terms/>

select * where {<http://http://dbpedia.org/page/Apple> ?property ?value}

Upvotes: 0

Views: 1353

Answers (2)

Pratiksha Sharma
Pratiksha Sharma

Reputation: 79

I am giving you the query which will give you information about Apple Company rather than apple Fruit.

PREFIX dbprop: <http://dbpedia.org/property/>
PREFIX db: <http://dbpedia.org/resource/>
SELECT ?property, ?value WHERE {db:Apple_Inc ?property ?value}

Upvotes: 2

svick
svick

Reputation: 244777

You wrote http:// twice. Also, the correct URI for the query is /resource/, not /page/.

Working query:

select * where {<http://dbpedia.org/resource/Apple> ?property ?value}

Keep in mind this will give you information about the fruit, not the company.

Upvotes: 2

Related Questions