Skip to content

Commit ad559ab

Browse files
committed
Improve Turtle output
1 parent 4fa4cc9 commit ad559ab

File tree

1 file changed

+40
-10
lines changed

1 file changed

+40
-10
lines changed

ogc/bblocks/register-context.yaml

Lines changed: 40 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
transform:
22
# Add @type from itemClass with initial capital letter
3-
- '.bblocks |= [ .[] | ."@type" = [("bblocks:" + (.itemClass[:1]|ascii_upcase) + .itemClass[1:]), "skos:Concept", "dcat:Dataset"] ]'
3+
- |
4+
.bblocks |= map(
5+
."@id" = "bblocks://\(.itemIdentifier)"
6+
| ."@type" = [("bblocks:" + (.itemClass[:1]|ascii_upcase) + .itemClass[1:]), "skos:Concept", "dcat:Dataset"]
7+
| ."skos:prefLabel" = .name
8+
| .ldContext |= if . then { "prof:hasArtifact": . , "prof:hasRole": "role:mapping", "dct:format": "application/ld+json" } else null end
9+
| .shaclShapes |= (if length > 0 then to_entries | map({ "prof:hasArtifact": .value, "rdfs:seeAlso": "bblocks://\(.key)", "prof:hasRole": "role:validation", "dct:format": "text/turtle", "dct:conformsTo": "shacl:" }) else null end)
10+
| .schema |= (if length > 0 then to_entries | map({ "prof:hasArtifact": .value , "prof:hasRole": "role:schema", "dct:format": .key }) else null end)
11+
| .dependsOn |= if length > 0 then map("bblocks://\(.)") else null end
12+
| .profileOf |= if length > 0 then map("bblocks://\(.)") else null end
13+
)
414
# Add ConceptScheme
515
- |
616
if type == "array" then {
@@ -27,8 +37,12 @@ context:
2737
prof: http://www.w3.org/ns/dx/prof/
2838
dcat: http://www.w3.org/ns/dcat#
2939
modspec: http://www.opengis.net/def/ont/modspec/
40+
void: http://rdfs.org/ns/void#
41+
foaf: http://xmlns.com/foaf/0.1/
42+
role: http://www.w3.org/ns/dx/prof/role/
43+
shacl: https://www.w3.org/TR/shacl/
44+
owl: http://www.w3.org/2002/07/owl#
3045

31-
itemIdentifier: '@id'
3246
baseURL: '@id'
3347
name: rdfs:label
3448
abstract:
@@ -54,6 +68,9 @@ context:
5468
dateOfLastChange:
5569
'@id': dct:modified
5670
'@type': xsd:date
71+
modified:
72+
'@id': dct:modified
73+
'@type': xsd:dateTime
5774
scope:
5875
'@id': bblocks:scope
5976
'@type': '@id'
@@ -65,12 +82,10 @@ context:
6582
title: rdfs:label
6683
link: '@id'
6784
schema:
68-
'@id': bblocks:hasSchema
85+
'@id': prof:hasResource
6986
'@type': '@id'
70-
'@container': '@index'
71-
'@index': dct:format
7287
ldContext:
73-
'@id': bblocks:hasJsonLdContext
88+
'@id': prof:hasResource
7489
'@type': '@id'
7590
sourceLdContext:
7691
'@id': bblocks:hasSourceJsonLdContext
@@ -83,6 +98,8 @@ context:
8398
'@context':
8499
mediatype: dct:format
85100
url: rdfs:isDefinedBy
101+
rdfs:isDefinedBy:
102+
'@type': '@id'
86103
hasConcepts:
87104
'@reverse': skos:inScheme
88105
dependsOn:
@@ -93,16 +110,29 @@ context:
93110
'@type': '@id'
94111
tags: dcat:keyword
95112
shaclShapes:
96-
'@id': bblocks:hasShaclRule
113+
'@id': prof:hasResource
97114
'@type': '@id'
98-
'@container': '@index'
99-
'@index': rdfs:seeAlso
100115
validationReport:
101116
'@id': bblocks:hasValidationReport
102117
'@type': '@id'
118+
validationPassed: bblocks:validationPassed
103119
imports:
104-
'@id': bblocks:imports
120+
'@id': owl:imports
105121
'@type': '@id'
106122
conformanceClasses:
107123
'@id': modspec:class
108124
'@type': '@id'
125+
sparqlEndpoint:
126+
'@id': void:sparqlEndpoint
127+
'@type': '@id'
128+
viewerURL:
129+
'@id': foaf:homepage
130+
'@type': '@id'
131+
dct:conformsTo:
132+
'@type': '@id'
133+
prof:hasRole:
134+
'@type': '@id'
135+
prof:hasArtifact:
136+
'@type': '@id'
137+
rdfs:seeAlso:
138+
'@type': '@id'

0 commit comments

Comments
 (0)