Help:WikiPathways SPARQL queries
From WikiPathways
(Difference between revisions)
(→Example queries) |
(→Example queries) |
||
Line 17: | Line 17: | ||
|Get all datasource currently captured in WikiPathways | |Get all datasource currently captured in WikiPathways | ||
|<pre>select distinct ?datasource count(?datasource) as ?numberEntries | |<pre>select distinct ?datasource count(?datasource) as ?numberEntries | ||
- | + | WHERE { | |
+ | ?concept dc:source ?datasource | ||
+ | } </pre> | ||
|[http://sparqlbin.com/#c4cc8a9dbc4ccfea7e9db9db4fe6095f Execute] | |[http://sparqlbin.com/#c4cc8a9dbc4ccfea7e9db9db4fe6095f Execute] | ||
|- | |- | ||
|Get the number of entries per datasource in WikiPathways | |Get the number of entries per datasource in WikiPathways | ||
| <pre>SELECT DISTINCT ?datasource | | <pre>SELECT DISTINCT ?datasource | ||
- | WHERE | + | WHERE { |
- | + | ?concept dc:source ?datasource | |
+ | } </pre> | ||
| [http://sparqlbin.com/#518227bff329828bfed1a799c6430fee Execute] | | [http://sparqlbin.com/#518227bff329828bfed1a799c6430fee Execute] | ||
|- | |- |
Revision as of 15:41, 18 October 2012
On sparql.wikipathways.org wikipathways content is replicated. Currently this SPARQL endpoint is being developed, with very irregular updates.
Prefixes
Below are example queries. For readability we have omitted the prefixes. We use the following prefixes: (Not complete yet)
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> PREFIX dc: <http://purl.org/dc/elements/1.1/> PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX schema: <http://schema.org/>
Example queries
Get all datasource currently captured in WikiPathways | select distinct ?datasource count(?datasource) as ?numberEntries WHERE { ?concept dc:source ?datasource } | Execute |
Get the number of entries per datasource in WikiPathways | SELECT DISTINCT ?datasource WHERE { ?concept dc:source ?datasource } | Execute |
Extract contributors | SELECT DISTINCT ?contributor WHERE { ?pathway dc:contributor ?contributor } | Execute |
Extract the amount of pathways edited per contributor | SELECT DISTINCT ?contributor, count(?pathway) as ?pathwaysEdited WHERE { ?pathway dc:contributor ?contributor } ORDER BY DESC(?pathwaysEdited) | Execute |
find the pathways a user have edited so far. Change the name in the query | SELECT DISTINCT ?pathway, ?pathwayLabel WHERE { ?pathway dc:contributor wpuser:Andra . ?pathway dc:contributor ?contributor . ?pathway rdfs:label ?pathwayLabel . } | Execute |