Search code examples
sparqlwikidata-query-service

Wikidata property statement and property direct


I'm trying to retrieve entities as well as their properties that relate to Golden Gate Bridge. I used this query (https://query.wikidata.org/#SELECT%20%3Fp2%20%3Fs%0AWHERE%0A%7B%0A%20%20%09%3Fs%20%3Fp2%20wd%3AQ44440%20.%0A%7D):

SELECT ?p2 ?s
WHERE
{
    ?s ?p2 wd:Q44440 .
}

But I noticed that in the result, property "p:statement/P800" and property "wdt:P800" actually point to the same thing. They have the same id. I'm wondering why it returns both. What is their difference? How do I just get one?

I use DBpedia a lot, so I'm not familiar with they uri schemes in Wikidata, it's quite confusing.


Solution

  • I guess it has something to do with the option to do reification on the statements itself, at least that's what I understand from the documentation here: https://www.wikidata.org/wiki/Wikidata:Glossary#Claims_and_statements That's why they use multiple namespace for the same property. You can see it better if you change your query to

    SELECT ?s ?p
    WHERE
    {
        ?s ?p wd:Q44440 .
        ?p a owl:ObjectProperty
    }
    

    It returns, among others,

    +-------------------------------------------------------------+------------------+
    |                              s                              |        p         |
    +-------------------------------------------------------------+------------------+
    | wd:Q16803333                                                | wdt:P301         |
    | wd:Q261174                                                  | wdt:P800         |
    | wd:Q950029                                                  | wdt:P921         |
    | wd:statement/Q16803333-12EFD280-98AF-4CA1-BEA3-5C142674827D | p:statement/P301 |
    | wd:statement/Q261174-4B53E291-A47B-48E3-AE28-7FDE75849E28   | p:statement/P800 |
    | wd:statement/Q950029-fd9f357a-45ff-403a-86ba-b462acb2ffbd   | p:statement/P921 |
    +-------------------------------------------------------------+------------------+
    

    In that case you can see that the subjects also have a different namespace with statement as keyword. And about those statements you could make statements as well, called reification.