2

I really do not understand the differences between the 2 prefix, and if possible, can someone explain via an example when to use them appropriately?

Loredra L
  • 1,485
  • 2
  • 16
  • 32
  • 4
    These prefixes are not part of SPARQL or RDF specifications... I guess you mean [Wikidata data model](https://www.mediawiki.org/wiki/Wikibase/Indexing/RDF_Dump_Format). – Stanislav Kralin Aug 08 '18 at 13:00
  • 2
    `PREFIX` declarations are arbitrary, though there are some "generally accepted" or even "recommended", as you can explore on . Turtle files and SPARQL queries that include [prefixed names](https://www.w3.org/TR/sparql11-query/#prefNames) and omit the `PREFIX` declarations are *not* valid Turtle nor SPARQL. Anytime you encounter `p:` or `ps:`, there should also be a full prefix declaration. (Note as well that prefix.cc doesn't have any info on [p:](http://prefix.cc/p), and [ps:](http://prefix.cc/ps) only leads to [PaySwarm](https://w3id.org/payswarm#).) – TallTed Aug 13 '18 at 22:42
  • 1
    [Presuming you're asking](https://stackoverflow.com/help/how-to-ask) about Wikidata (in which case, please [add an appropriate tag](https://stackoverflow.com/help/tagging)), it's quite confusing when you *ought* to use each -- because, for instance, both their `p:P22` (<[http://www.wikidata.org/prop/P22](http://www.wikidata.org/prop/P22)>) and `ps:22` (<[http://www.wikidata.org/prop/statement/P22](http://www.wikidata.org/prop/statement/P22)>) lead to the same description page, [https://www.wikidata.org/wiki/Property:P22](https://www.wikidata.org/wiki/Property:P22). – TallTed Aug 13 '18 at 22:53
  • I think this might help you along. An example is provided. https://stackoverflow.com/questions/36023098/querying-wikidata-difference-between-p-and-wdt-default-prefix – user17527171 Nov 27 '21 at 22:18

1 Answers1

0

Here on Stackoverflow, there is an older question going in a similar direction, and the answer to it includes the answer to your issue:

Querying WikiData, difference between p and wdt default prefix

In Wikidata, p stands for "property", ps stands for "property statement". So ps introduces an additional condition into a query if you either want to find "statements without a specific qualifier for a given property" or "statements without any qualifier for a given property".

Both use cases are explained in the Wikidata SPARQL documentation:

https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries#Statements_without_a_specific_qualifier_for_a_given_property

For items with a selected property p, statements ps are chosen that do not have a specific qualifier pq, or no qualifier at all.

OnceUponATime
  • 450
  • 4
  • 12