-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathfrink_immport.sparql
More file actions
77 lines (66 loc) · 2.21 KB
/
Copy pathfrink_immport.sparql
File metadata and controls
77 lines (66 loc) · 2.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# SPARQL Queries for Querying ImmPort Data in FRINK
#
# These queries work with Schema.org vocabulary used in our RDF conversion
# Note: Our data uses schema:name, not rdfs:label or dc:title
PREFIX schema: <http://schema.org/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX okn: <https://okn.wobd.org/>
# Query 1: Find datasets with names (equivalent to the FRINK query but using Schema.org)
SELECT DISTINCT ?subject ?label
WHERE {
?subject rdf:type schema:Dataset ;
schema:name ?label .
FILTER(REGEX(STR(?subject), "^https://okn\\.wobd\\.org/dataset/immport/"))
}
LIMIT 100
# Query 2: Find all resources with names (datasets, persons, organizations, etc.)
SELECT DISTINCT ?subject ?label
WHERE {
{
?subject rdf:type schema:Dataset ;
schema:name ?label .
FILTER(REGEX(STR(?subject), "^https://okn\\.wobd\\.org/"))
}
UNION
{
?subject rdf:type schema:Person ;
schema:name ?label .
FILTER(REGEX(STR(?subject), "^https://okn\\.wobd\\.org/"))
}
UNION
{
?subject rdf:type schema:Organization ;
schema:name ?label .
FILTER(REGEX(STR(?subject), "^https://okn\\.wobd\\.org/"))
}
UNION
{
?subject rdf:type schema:MonetaryGrant ;
schema:name ?label .
FILTER(REGEX(STR(?subject), "^https://okn\\.wobd\\.org/"))
}
}
LIMIT 100
# Query 3: Find ImmPort datasets with names and DOIs
SELECT DISTINCT ?dataset ?name ?doi
WHERE {
?dataset rdf:type schema:Dataset ;
schema:name ?name .
OPTIONAL { ?dataset schema:sameAs ?doi . }
FILTER(REGEX(STR(?dataset), "^https://okn\\.wobd\\.org/dataset/immport/"))
}
LIMIT 100
# Query 4: Count ImmPort datasets in FRINK
SELECT (COUNT(DISTINCT ?dataset) AS ?totalImmPortDatasets)
WHERE {
?dataset rdf:type schema:Dataset .
FILTER(REGEX(STR(?dataset), "^https://okn\\.wobd\\.org/dataset/immport/"))
}
# Query 5: If you need to check what vocabularies are actually used
SELECT DISTINCT ?property
WHERE {
?subject ?property ?object .
FILTER(REGEX(STR(?subject), "^https://okn\\.wobd\\.org/dataset/immport/"))
}
LIMIT 50