Skip to content

Instantly share code, notes, and snippets.

View ColinMaudry's full-sized avatar

Colin Maudry ColinMaudry

View GitHub Profile
@ColinMaudry
ColinMaudry / mp.ttl
Created May 31, 2015 00:06
Turtle for a MP
<#columnAline1> rdf:type ex:MP ;
rdf:type foaf:Person ;
foaf:name “Bernard Accoyer” .
@ColinMaudry
ColinMaudry / query.rq
Last active August 29, 2015 14:22
Test SPARQL with cURL and Wikidata (describe entity)
describe <http://www.wikidata.org/entity/Q866405>
@ColinMaudry
ColinMaudry / source.xml
Last active August 29, 2015 14:22
Testing XSLT priority
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "dtd/technicalContent/dtd/topic.dtd">
<topic class=" topic/topic " id="mytopic">
<title class=" topic/title">Stairway to heaven</title>
<body class=" topic/body">
<p class=" topic/p">There's a lady who's sure, <b outputclass="strong" class=" topic/ph hi-d/b">all</b> that glitters is gold.</p>
</body>
</topic>
@ColinMaudry
ColinMaudry / query.rq
Last active August 29, 2015 14:22
Test SPARQL with cURL and Wikidata (entity types)
#Selects the first 20 types of entities encountered:
select distinct ?type where {
?thing <http://www.wikidata.org/prop/direct/P31> ?type
}
limit 20
@ColinMaudry
ColinMaudry / gist:6fd6a5f610f0ac3e6696
Last active November 24, 2023 15:46
cURL examples to query Wikidata

SPARQL Queries (with cURL command) on Wikidata

This gist resulted to be just the spark for a proper article, and won't be maintained here anymore.

The SPARQL endpoint is http://wdqs-beta.wmflabs.org/bigdata/namespace/wdq/sparql and it has a Web form to fire queries. However http://www.wikidata.org/prop/direct/P31 ("instance of") tells you what the entity is.

The repository doesn't have named graphs, or at least the SPARQL endpoint rejects graph queries. The classes of entities (rdf:type) are not described in the repository.

To find the HTML page of an entity (such as https://www.wikidata.org/entity/Q866405), simply replace /entity/ with /wiki/.