Skip to content

Commit

Permalink
Added specification files and SPARQL queries
Browse files Browse the repository at this point in the history
  • Loading branch information
seyedahbr committed Feb 16, 2023
1 parent dc7bba7 commit fd224b2
Show file tree
Hide file tree
Showing 24 changed files with 891 additions and 0 deletions.
8 changes: 8 additions & 0 deletions SPARQL/condition-1/count-General-military-Politicians.sparql
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>

SELECT (COUNT (DISTINCT ?item) AS ?count) WHERE{
?item wdt:P106 wd:Q82955 ; # occupation of politician
wdt:P106 wd:Q189290 ; # occupation of milit. officer
wdt:P410 wd:Q83460 . # military rank of general
}
7 changes: 7 additions & 0 deletions SPARQL/condition-1/count-UK-Universities.sparql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>

SELECT (COUNT (DISTINCT ?item) AS ?count) WHERE{
?item wdt:P31 wd:Q3918 ; # instance of university
wdt:P17 wd:Q145 . # country of United Kingdom
}
38 changes: 38 additions & 0 deletions SPARQL/condition-1/count-gene-wiki.sparql
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>

SELECT (COUNT (DISTINCT ?item) AS ?count) WHERE{
{?item wdt:P31 wd:Q423026 .} # instance of active site
UNION
{?item wdt:P31 wd:Q4936952 .} # instance of anat. struct.
UNION
{?item wdt:P31 wd:Q616005 .}
UNION
{?item wdt:P31 wd:Q4915012 .}
UNION
{?item wdt:P31 wd:Q11173 .}
UNION
{?item wdt:P31 wd:Q12136 .}
UNION
{?item wdt:P31 wd:Q7187 .}
UNION
{?item wdt:P31 wd:Q12140 .}
UNION
{?item wdt:P31 wd:Q28885102 .}
UNION
{?item wdt:P31 wd:Q50377224 .}
UNION
{?item wdt:P31 wd:Q898273 .}
UNION
{?item wdt:P31 wd:Q417841 .}
UNION
{?item wdt:P31 wd:Q8054 .}
UNION
{?item wdt:P31 wd:Q215980 .}
UNION
{?item wdt:P31 wd:Q15304597 .}
UNION
{?item wdt:P31 wd:Q7644128 .}
UNION
{?item wdt:P31 wd:Q50379781 .} # instance of therap. use
}
6 changes: 6 additions & 0 deletions SPARQL/condition-1/count-politician.sparql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>

SELECT (COUNT (DISTINCT ?item) AS ?count) WHERE{
?item wdt:P106 wd:Q82955 . # occupation of politician
}
2 changes: 2 additions & 0 deletions SPARQL/condition-2/General-military-Politician.sparql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
PREFIX wd: <http://www.wikidata.org/entity/>
DESCRIBE wd:Q355643
2 changes: 2 additions & 0 deletions SPARQL/condition-2/UK-University.sparql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
PREFIX wd: <http://www.wikidata.org/entity/>
DESCRIBE wd:1094046
2 changes: 2 additions & 0 deletions SPARQL/condition-2/gene-wiki.sparql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
PREFIX wd: <http://www.wikidata.org/entity/>
DESCRIBE wd:30555
2 changes: 2 additions & 0 deletions SPARQL/condition-2/politician.sparql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
PREFIX wd: <http://www.wikidata.org/entity/>
DESCRIBE wd:Q23
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX pr: <http://www.wikidata.org/prop/reference/>
PREFIX prov: <http://www.w3.org/ns/prov#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>

SELECT (COUNT (DISTINCT ?qualifier) as ?count)
WHERE{
wd:Q355643 p:P485 ?statement.
?statement ?property ?qualifier .
FILTER regex(str(?property), "http://www.wikidata.org/prop/qualifier/")
}
13 changes: 13 additions & 0 deletions SPARQL/condition-3/count-qualifiers-UK-University.sparql
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX pr: <http://www.wikidata.org/prop/reference/>
PREFIX prov: <http://www.w3.org/ns/prov#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>

SELECT (COUNT (DISTINCT ?qualifier) as ?count)
WHERE{
wd:Q1094046 p:P355 ?statement.
?statement ?property ?qualifier .
FILTER regex(str(?property), "http://www.wikidata.org/prop/qualifier/")
}
13 changes: 13 additions & 0 deletions SPARQL/condition-3/count-qualifiers-gene-wiki.sparql
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX pr: <http://www.wikidata.org/prop/reference/>
PREFIX prov: <http://www.w3.org/ns/prov#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>

SELECT (COUNT (DISTINCT ?qualifier) as ?count)
WHERE{
wd:Q17487737 p:P680 ?statement.
?statement ?property ?qualifier .
FILTER regex(str(?property), "http://www.wikidata.org/prop/qualifier/")
}
13 changes: 13 additions & 0 deletions SPARQL/condition-3/count-qualifiers-politician.sparql
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX pr: <http://www.wikidata.org/prop/reference/>
PREFIX prov: <http://www.w3.org/ns/prov#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>

SELECT (COUNT (DISTINCT ?qualifier) as ?count)
WHERE{
wd:Q23 p:P26 ?statement.
?statement ?property ?qualifier .
FILTER regex(str(?property), "http://www.wikidata.org/prop/qualifier/")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX pr: <http://www.wikidata.org/prop/reference/>
PREFIX prov: <http://www.w3.org/ns/prov#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>

SELECT (COUNT (DISTINCT ?reference) as ?count)
WHERE{
wd:Q355643 p:P485 ?statement.
?statement prov:wasDerivedFrom ?reference .
}
12 changes: 12 additions & 0 deletions SPARQL/condition-3/count-references-UK-University.sparql
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX pr: <http://www.wikidata.org/prop/reference/>
PREFIX prov: <http://www.w3.org/ns/prov#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>

SELECT (COUNT (DISTINCT ?reference) as ?count)
WHERE{
wd:Q1094046 p:P355 ?statement.
?statement prov:wasDerivedFrom ?reference .
}
12 changes: 12 additions & 0 deletions SPARQL/condition-3/count-references-gene-wiki.sparql
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX pr: <http://www.wikidata.org/prop/reference/>
PREFIX prov: <http://www.w3.org/ns/prov#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>

SELECT (COUNT (DISTINCT ?reference) as ?count)
WHERE{
wd:Q17487737 p:P680 ?statement.
?statement prov:wasDerivedFrom ?reference .
}
12 changes: 12 additions & 0 deletions SPARQL/condition-3/count-references-politician.sparql
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX pr: <http://www.wikidata.org/prop/reference/>
PREFIX prov: <http://www.w3.org/ns/prov#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>

SELECT (COUNT (DISTINCT ?reference) as ?count)
WHERE{
wd:Q23 p:P26 ?statement.
?statement prov:wasDerivedFrom ?reference .
}
Loading

0 comments on commit fd224b2

Please sign in to comment.