forked from sib-swiss/sparql-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
@prefix ex: <https://bigcat-um.github.io/sparql-examples/WikiPathways/> . | ||
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . | ||
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . | ||
@prefix schema: <https://schema.org/> . | ||
@prefix sh: <http://www.w3.org/ns/shacl#> . | ||
|
||
ex:001 a sh:SPARQLExecutable, | ||
sh:SPARQLSelectExecutable ; | ||
rdfs:comment "Lists journals that have CiTO citation intentions defined and returns the number of citation statements as well as the number of citing articles."@en ; | ||
sh:prefixes _:sparql_examples_prefixes ; | ||
sh:select """PREFIX wd: <https://compoundcloud.wikibase.cloud/entity/> | ||
PREFIX wdt: <https://compoundcloud.wikibase.cloud/prop/direct/> | ||
PREFIX wikibase: <http://wikiba.se/ontology#> | ||
PREFIX bd: <http://www.bigdata.com/rdf#> | ||
PREFIX rdfs: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||
PREFIX p: <http://www.wikidata.org/prop/> | ||
PREFIX ps: <http://www.wikidata.org/prop/statement/> | ||
PREFIX pq: <http://www.wikidata.org/prop/qualifier/> | ||
SELECT ?journal ?journalLabel (CONCAT("/venue/", SUBSTR(STR(?journal), 32), "#cito") AS ?journalUrl) | ||
(COUNT(DISTINCT ?citationStatement) AS ?citations) | ||
(COUNT(DISTINCT ?citingArticle) AS ?articles) WHERE { | ||
?citingArticle p:P2860 ?citationStatement ; | ||
wdt:P1433 ?journal . | ||
?citationStatement pq:P3712 ?intention ; | ||
ps:P2860 ?citedArticle . | ||
?intention wdt:P31 wd:Q96471816 . | ||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en". } | ||
} GROUP BY ?journal ?journalLabel | ||
ORDER BY DESC(?citations)""" ; | ||
schema:target <https://query.wikidata.org/sparql> ; | ||
schema:keywords "journal", "CiTO", "citation" . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
@prefix sh: <http://www.w3.org/ns/shacl#> . | ||
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . | ||
@prefix owl: <http://www.w3.org/2002/07/owl#> . | ||
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . | ||
|
||
_:vhp4safety_sparql_examples_prefixes a owl:Ontology ; | ||
rdfs:comment """This is a collection of Wikidata SPARQL prefixes that are needed for the examples for use on different websites.""" ; | ||
owl:imports sh: ; | ||
sh:declare [ sh:prefix "wd" ; sh:namespace "http://wikidata.org/entity/"^^xsd:anyURI ] ; | ||
sh:declare [ sh:prefix "wdt" ; sh:namespace "http://wikidata.org/prop/direct/"^^xsd:anyURI ] ; | ||
sh:declare [ sh:prefix "wikibase" ; sh:namespace "http://wikiba.se/ontology#"^^xsd:anyURI ] ; | ||
sh:declare [ sh:prefix "bd" ; sh:namespace "http://www.bigdata.com/rdf#"^^xsd:anyURI ] ; | ||
sh:declare [ sh:prefix "rdfs" ; sh:namespace "http://www.w3.org/1999/02/22-rdf-syntax-ns#"^^xsd:anyURI ] . |