-
Notifications
You must be signed in to change notification settings - Fork 0
/
ddw-standard-index.ttl
143 lines (123 loc) · 4.69 KB
/
ddw-standard-index.ttl
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
@prefix vg: <https://data.world/vg/1.0/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix aice: <https://data.world/aice/1.0/> .
### SIMPLE INDEXES (ALL CLASSES/PREDICATES IN DATASET)
# Index all classes and predicates in a dataset
aice:ClassIndex
a vg:VectorIndex ;
aice:indexType owl:Class ;
vg:model vg:mxbai_embed_large_v1 ;
vg:indexerQuery """
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX dct: <http://purl.org/dc/terms/>
PREFIX aice: <https://data.world/aice/1.0/>
SELECT ?iri (GROUP_CONCAT(?content; SEPARATOR = " ") AS ?value)
WHERE {
# Grab a bunch of predicates and concat them
VALUES ?predicate { rdfs:label dct:title rdfs:comment dct:description }
# pulls dynamically from the graph to allow for extension
aice:ClassIndex aice:indexType ?class .
?iri a/rdfs:subClassOf* ?class.
?iri ?predicate ?content.
}
GROUP BY ?iri
"""
.
aice:ObjectPropertyIndex
a vg:VectorIndex ;
aice:indexType owl:ObjectProperty ;
vg:model vg:mxbai_embed_large_v1 ;
vg:indexerQuery """
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX dct: <http://purl.org/dc/terms/>
PREFIX aice: <https://data.world/aice/1.0/>
SELECT ?iri (GROUP_CONCAT(?content; SEPARATOR = " ") AS ?value)
WHERE {
# Grab a bunch of predicates and concat them
VALUES ?predicate { rdfs:label dct:title rdfs:comment dct:description }
# pulls dynamically from the graph to allow for extension
aice:ObjectPropertyIndex aice:indexType ?class .
?iri a/rdfs:subClassOf* ?class.
?iri ?predicate ?content.
}
GROUP BY ?iri
"""
.
aice:DatatypePropertyIndex
a vg:VectorIndex ;
aice:indexType owl:DatatypeProperty ;
vg:model vg:mxbai_embed_large_v1 ;
vg:indexerQuery """
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX dct: <http://purl.org/dc/terms/>
PREFIX aice: <https://data.world/aice/1.0/>
SELECT ?iri (GROUP_CONCAT(?content; SEPARATOR = " ") AS ?value)
WHERE {
# Grab a bunch of predicates and concat them
VALUES ?predicate { rdfs:label dct:title rdfs:comment dct:description }
# pulls dynamically from the graph to allow for extension
aice:DatatypePropertyIndex aice:indexType ?class .
?iri a/rdfs:subClassOf* ?class.
?iri ?predicate ?content.
}
GROUP BY ?iri
"""
.
### MAPPED INDEXES (ONLY MAPPED CLASSES/PREDICATES IN DATASET)
# These indexes pull from the r2rml to determine the correct classes/predicates to index
aice:MappedClassIndex
a vg:VectorIndex ;
vg:model vg:mxbai_embed_large_v1 ;
vg:indexerQuery """
PREFIX rr: <http://www.w3.org/ns/r2rml#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?iri (GROUP_CONCAT(?content; SEPARATOR = " ") AS ?value)
WHERE {
[rr:class ?class].
?iri rdfs:subClassOf* ?class ;
a owl:Class.
VALUES ?contentPredicate {rdfs:label dct:title rdfs:comment dct:description}
?iri ?contentPredicate ?content.
}
GROUP BY ?iri
"""
.
aice:MappedObjectPropertyIndex
a vg:VectorIndex ;
vg:model vg:mxbai_embed_large_v1 ;
vg:indexerQuery """
PREFIX rr: <http://www.w3.org/ns/r2rml#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
SELECT ?iri (GROUP_CONCAT(?content; SEPARATOR = " ") AS ?value)
WHERE {
[rr:predicate ?predicate].
?iri rdfs:subPropertyOf* ?predicate.
?predicate a owl:ObjectProperty.
VALUES ?contentPredicate {rdfs:label dct:title rdfs:comment dct:description}
?iri ?contentPredicate ?content.
}
GROUP BY ?iri
"""
.
aice:MappedDatatypePropertyIndex
a vg:VectorIndex ;
vg:model vg:mxbai_embed_large_v1 ;
vg:indexerQuery """
PREFIX rr: <http://www.w3.org/ns/r2rml#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX csvw: <http://www.w3.org/ns/csvw#>
SELECT ?iri (GROUP_CONCAT(?content; SEPARATOR = " ") AS ?value)
WHERE {
[rr:predicate ?predicate].
?iri rdfs:subPropertyOf* ?predicate.
?predicate a owl:DatatypeProperty.
FILTER NOT EXISTS { ?iri a csvw:Column }
VALUES ?contentPredicate {rdfs:label dct:title rdfs:comment dct:description}
?iri ?contentPredicate ?content.
}
GROUP BY ?iri
"""
.