WikiData request, difference between default prefix p and wdt

I am new to Wikidata and I cannot figure out when I should use ->

wdt prefix ( http://www.wikidata.org/prop/direct/ )

and when should I use ->

p prefix ( http://www.wikidata.org/prop/ ).

in my sparql queries. Can someone explain what each of them means and what is the difference?

+7
source share
2 answers

XML, URI. , wdt: , URI http://www.wikidata.org/prop/direct/Apples p: fruitType URI http://www.wikidata.org/prop/fruitType.

/ , - URL-. , http://www.wikidata.org/prop/, , "", , ( ).

, - " p: P51 p: P15 , , wdt: P51?". , , "" .

+1

p: . wdt: entites.

p:, ps: pq: . , ; - .

, :

SELECT ?graffiti ?graffitiLabel
WHERE
{
    ?graffiti p:P31 ?statement .  # entities that are statements
    ?statement ps:P31 wd:Q17514 . # which state something is graffiti
    SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}

P31, . , . p: , ps: . p:P31 . , . ps:P31 () .

! wdt: . :

SELECT ?graffiti ?graffitiLabel
WHERE
{
    ?graffiti wdt:P31 wd:Q17514 . # entities that are graffiti
    SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}

, , . p: ps: wdt: P31. :

  • , , . ("T" wdt: "").
  • , wdt:, . , p: ps: , wdt:.
+1

All Articles