-
Notifications
You must be signed in to change notification settings - Fork 0
/
sample_query.rq
46 lines (42 loc) · 1.91 KB
/
sample_query.rq
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
PREFIX rdf: <http:https://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX : <http:https://data.europa.eu/xsp/cn2022/>
PREFIX nace: <http:https://data.europa.eu/ux2/nace2/>
PREFIX fn: <http:https://www.w3.org/2005/xpath-functions#>
PREFIX foaf: <http:https://xmlns.com/foaf/0.1/>
PREFIX gn: <http:https://www.geonames.org/ontology#>
PREFIX grddl: <http:https://www.w3.org/2003/g/data-view#>
PREFIX lemon: <http:https://lemon-model.net/lemon#>
PREFIX lexinfo: <http:https://www.lexinfo.net/ontology/2.0/lexinfo#>
PREFIX lexvo: <http:https://lexvo.org/ontology#>
PREFIX locn: <https://www.w3.org/ns/locn#>
PREFIX luc: <http:https://www.ontotext.com/owlim/lucene#>
PREFIX oa: <http:https://www.w3.org/ns/oa#>
PREFIX org: <http:https://www.w3.org/ns/org#>
PREFIX owl: <http:https://www.w3.org/2002/07/owl#>
PREFIX qb: <http:https://purl.org/linked-data/cube#>
PREFIX rdf4j: <http:https://rdf4j.org/schema/rdf4j#>
PREFIX rdfs: <http:https://www.w3.org/2000/01/rdf-schema#>
PREFIX schema: <http:https://schema.org/>
PREFIX sesame: <http:https://www.openrdf.org/schema/sesame#>
PREFIX skos: <http:https://www.w3.org/2004/02/skos/core#>
PREFIX xkos: <http:https://rdf-vocabulary.ddialliance.org/xkos#>
SELECT (?S_KEY as ?CN2022_KEY) (?S_CODE as ?CN2022_CODE) (?NAME_Source as ?CN2022_NAME) (?T_KEY as ?CN2021_KEY) (?T_CODE as ?CN2021_CODE) (?NAME_Target as ?CN2021_NAME)
WHERE {
:CN2022_CN2021 xkos:madeOf ?Associations .
?Associations xkos:sourceConcept ?Source .
?Source skos:notation ?S_Notation;
skos:altLabel ?S_Name;
dc:identifier ?S_KEY .
BIND (STR(?S_Notation) as ?S_CODE)
BIND (STR(?S_Name) AS ?NAME_Source)
FILTER (LANG(?S_Name) = "en")
FILTER (regex(?S_CODE = "^6202*30.*"))
OPTIONAL { ?Associations rdfs:comment ?Comment . }
OPTIONAL { ?Associations xkos:targetConcept ?Target .
?Target skos:notation ?T_Notation ;
skos:altLabel ?T_Name;
dc:identifier ?T_KEY .}
FILTER (LANG(?T_Name) = "en")
BIND (STR(?T_Name) AS ?NAME_Target)
BIND (STR(?T_Notation) as ?T_CODE )
} LIMIT 10