jason
jason

Reputation: 3962

get dbpedia type/category for any word

I am trying to get type/category to which the word belongs to like if its basketball then its under the category sports and if its tea then beverage is the category.

I tried :

select * where {basketball} LIMIT 100

and

PREFIX dbpedia-owl: <http://dbpedia.org/ontology/>
PREFIX dbpprop: <http://dbpedia.org/property/>
PREFIX dbres: <http://dbpedia.org/resource/>

select ? {
    a owl:basketball .
}
limit 10

also

PREFIX dbpedia-owl: <http://dbpedia.org/ontology/>
PREFIX dbpprop: <http://dbpedia.org/property/>
PREFIX dbres: <http://dbpedia.org/resource/>

SELECT ?y WHERE {
 ?y dbpedia-owl:binomialAuthority dbres:basketball.
 }

limit 10

but there is a query error especially if I dont know the property of the word typed.How can I get the name of the category.

Upvotes: 0

Views: 894

Answers (1)

Ali Ismayilov
Ali Ismayilov

Reputation: 1755

May be you can query rdf:type of basketball.

PREFIX dbres: <http://dbpedia.org/resource/>
PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
select ?o where {dbres:Basketball rdf:type ?o} LIMIT 10

Demo

Upvotes: 3

Related Questions