Hi,
To respond (partially) to my own question: SPARQL does do the job for
me, e.g.:
select distinct ?person where {?person ?p ?prop .
?prop ps:P31 wd:Q5 .
} limit 100
returns a list of person URLs. So I'm happy. However, I am still
intrigued as to the logic behind the redirection of the statement URL to
the URL for the person about whom the statement is being made.
Thanks,
Richard
On 2016-06-13 10:51 AM, Richard Light wrote:
Hi,
I'm trying to get to grips with using Wikidata as a Linked Data
resource, and would welcome some guidance.
Using the SPARQL end-point [1], I submit a query which looks for people:
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX wd: <http://www.wikidata.org/entity/>
describe ?s where {?s ps:P31 wd:Q5 .
} limit 100
The results give a set of wd:statement URLs (e.g. [2]), each of which
has the required 'P31 Q5' property and four others (wikibase:rank,
rdf:type and a couple of 'derived from' properties). So this looks
like a simple statement, which is in some sense a property of the
person I am looking for. I would then expect to refine my SPARQL
query to pick up the person about whom this statement was made, and
thereby get access to their other properties.
However, when I dereference the statement URL, I find that I have
magically arrived at the URL of the person themselves [3].
While this is all very clever, it leaves me at a loss as to how I can
access the properties of the person using SPARQL.
Thanks,
Richard
[1] https://query.wikidata.org/
[2]
http://www.wikidata.org/entity/statement/q23-935f9100-47ca-f387-7946-45f9db09e81f
[3] https://www.wikidata.org/wiki/Q23 when accessed through the
browser, or https://www.wikidata.org/wiki/Special:EntityData/q23 when
accessed through curl with a suitable Accept header
--
*Richard Light*
_______________________________________________
Wikidata-tech mailing list
Wikidata-tech@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-tech
--
*Richard Light*
_______________________________________________
Wikidata-tech mailing list
Wikidata-tech@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-tech