2
votes

I want to make a query ( SPARQL) to select from dbpedia DB:

  • the purpose of my query is to get the definition of any given name :

Example : i want to find the definition of name Victor

PREFIX foaf: <http://xmlns.com/foaf/0.1/>
CONSTRUCT { <http://example.org/person#Alice> foaf:description ?x }
FROM <http://example.org/foaf/people>
WHERE { ?x foaf:name ?name }
ORDER BY desc(?name)
LIMIT 10

I Think there's no foaf property called description , so i need the query which return this property

1
What have you tried? What keeps you from sending that query? What do you mean by "definition of name", which properties are you looking for specifically? - O. R. Mapper
i've tried this : PREFIX foaf: <xmlns.com/foaf/0.1> CONSTRUCT { <example.org/person#Alice> foaf:description ?x } FROM <example.org/foaf/people> WHERE { ?x foaf:name ?name } ORDER BY desc(?name) LIMIT 10 And i mean with definition : what does your name mean ? like Elias definition : "Yahweh is my God". Another form of Eliyahu in English is Elijah /ɨˈlaɪdʒə/. The name belonged most notably to Elijah, the Hebrew prophet. Thank you - Hsen Mchaimech
Can you edit that info in a formatted way into your question, please? - O. R. Mapper

1 Answers

4
votes

The DBpedia dataset has meanings of names. Here is one way of querying them with SPARQL:

PREFIX  dbpedia-owl:  <http://dbpedia.org/ontology/>
PREFIX      dbpprop:  <http://dbpedia.org/property/>
SELECT  ?name 
        ?meaning
  WHERE 
    {
      ?s                a  dbpedia-owl:Name
       ;     dbpprop:name  ?name 
       ;  dbpprop:meaning  ?meaning 
       .  FILTER (str(?name) = "Victor")
    }

Or, if you want RDF triples, use a CONSTRUCT query:

PREFIX  dbpedia-owl:  <http://dbpedia.org/ontology/>
PREFIX      dbpprop:  <http://dbpedia.org/property/>
CONSTRUCT { ?s  dbpprop:meaning  ?meaning }
WHERE 
  {
    ?s                a  dbpedia-owl:Name 
     ;     dbpprop:name  ?name 
     ;  dbpprop:meaning  ?meaning 
     .  FILTER (str(?name) = "Victor")
  }

I think that the FOAF vocabulary is mostly suitable for describing individual persons, organizations, documents, and so on, rather than more abstract concepts like meanings of names, so this is just using the original DBpedia vocabularies.