Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to know if a string is a proper name of person or a place name using DBpedia?
    primarykey
    data
    text
    <p>I am using SPARQL query on DBpedia into a Prolog project and I have a doubt. I would know if a word is, most probably, a <strong>NAME OF A PERSON</strong> (something like: John, Mario) or a <strong>PLACE</strong> (like a city: Rome, London, New York).</p> <p>I have implement the following two queries, the first gives me the number of persons having a specific name, and the second gives me the number of places having a specific name.</p> <p><strong>1) Query for a PERSON NAME:</strong></p> <pre><code>select COUNT(?person) where { ?person a dbpedia-owl:Person . { ?person foaf:givenName "John"@en } UNION { ?person foaf:surname "John"@en } } </code></pre> <p>For the name <strong>John</strong>, I obtain the following output: <strong>callret-0: 7313</strong>, so I think that it has found 7313 instances for the proper name John. Is it right?</p> <p><strong>2) Query for a PLACE NAME:</strong></p> <pre><code>select COUNT(?place) where { ?place a dbpedia-owl:Place . { ?x rdfs:label "John"@en } } </code></pre> <p>The problem is that, as you can see in the previous “place” query, I have inserted <strong>John</strong> as parameter, which is not a place name but a proper name of persons, but I obtain the following strange result: <strong>callret-0: 81900104</strong></p> <p>The problem is that, in this way, if I compare the output of the previous two queries, it seems that John is a place and not a person name! This is not good for my scope; I have tried with other personal names and it always happens that the place query gives me a bigger output than the name query.</p> <p>Why? What am I missing? Are there some errors in my queries? How can I solve it to have a correct result?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload