Skip to content

Commit

Permalink
Building blocks postprocessing
Browse files Browse the repository at this point in the history
  • Loading branch information
avillar committed Jan 9, 2024
1 parent bb487c9 commit 663c835
Show file tree
Hide file tree
Showing 20 changed files with 373 additions and 105 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
path @id
/properties/a https://example.org/my-bb-model/a
/properties/b https://example.org/my-bb-model/b
31 changes: 31 additions & 0 deletions build/annotated/bbr/examples/my-building-block/schema-oas3.0.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"x-defs": {
"ogc.bbr.examples.my-building-block": {
"description": "Schema for my building block",
"type": "object",
"properties": {
"a": {
"type": "string",
"format": "uri",
"x-jsonld-id": "https://example.org/my-bb-model/a",
"x-jsonld-type": "@id"
},
"b": {
"type": "number",
"x-jsonld-id": "https://example.org/my-bb-model/b"
}
},
"required": [
"a",
"b"
],
"x-schema-version": "https://json-schema.org/draft/2020-12/schema",
"x-schema-source": "https://ogcincubator.github.io/bblocks-examples/build/annotated/bbr/examples/my-building-block/schema-oas3.0.json"
}
},
"allOf": [
{
"$ref": "https://ogcincubator.github.io/bblocks-examples/build/annotated/bbr/examples/my-building-block/schema-oas3.0.json#/x-defs/ogc.bbr.examples.my-building-block"
}
]
}
20 changes: 20 additions & 0 deletions build/annotated/bbr/examples/my-building-block/schema-oas3.0.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
x-defs:
ogc.bbr.examples.my-building-block:
description: Schema for my building block
type: object
properties:
a:
type: string
format: uri
x-jsonld-id: https://example.org/my-bb-model/a
x-jsonld-type: '@id'
b:
type: number
x-jsonld-id: https://example.org/my-bb-model/b
required:
- a
- b
x-schema-version: https://json-schema.org/draft/2020-12/schema
x-schema-source: https://ogcincubator.github.io/bblocks-examples/build/annotated/bbr/examples/my-building-block/schema-oas3.0.yaml
allOf:
- $ref: https://ogcincubator.github.io/bblocks-examples/build/annotated/bbr/examples/my-building-block/schema-oas3.0.yaml#/x-defs/ogc.bbr.examples.my-building-block
4 changes: 2 additions & 2 deletions build/bblocks.jsonld
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"itemIdentifier": "ogc.bbr.examples.my-building-block",
"name": "My Building Block",
"abstract": "This Building Block serves as a template to create new ones",
"status": "invalid",
"status": "under-development",
"dateTimeAddition": "2023-04-05T00:00:00Z",
"itemClass": "schema",
"register": "ogc-building-block-register",
Expand All @@ -93,7 +93,7 @@
"tags": [
"templates"
],
"shaclRules": [],
"shaclRules": {},
"schema": {
"application/yaml": "https://ogcincubator.github.io/bblocks-examples/build/annotated/bbr/examples/my-building-block/schema.yaml",
"application/json": "https://ogcincubator.github.io/bblocks-examples/build/annotated/bbr/examples/my-building-block/schema.json"
Expand Down
14 changes: 7 additions & 7 deletions build/bblocks.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ bblocks:ogc.bbr.examples.my-building-block a skos:Concept,
dct:created "2023-04-05T00:00:00+00:00"^^xsd:dateTime ;
dct:description [ dct:format "application/json" ;
rdfs:isDefinedBy "https://ogcincubator.github.io/bblocks-examples/build/generateddocs/json-full/bbr/examples/my-building-block/index.json" ],
[ dct:format "text/markdown" ;
rdfs:isDefinedBy "https://ogcincubator.github.io/bblocks-examples/build/generateddocs/markdown/bbr/examples/my-building-block/index.md" ],
[ dct:format "text/html" ;
rdfs:isDefinedBy "https://ogcincubator.github.io/bblocks-examples/build/generateddocs/slate-build/bbr/examples/my-building-block/" ] ;
rdfs:isDefinedBy "https://ogcincubator.github.io/bblocks-examples/build/generateddocs/slate-build/bbr/examples/my-building-block/" ],
[ dct:format "text/markdown" ;
rdfs:isDefinedBy "https://ogcincubator.github.io/bblocks-examples/build/generateddocs/markdown/bbr/examples/my-building-block/index.md" ] ;
dct:hasVersion "0.1" ;
dct:modified "2023-04-05"^^xsd:date ;
dct:source <https://example.com/sources/1> ;
Expand All @@ -25,16 +25,16 @@ bblocks:ogc.bbr.examples.my-building-block a skos:Concept,
bblocks:hasSchema <https://ogcincubator.github.io/bblocks-examples/build/annotated/bbr/examples/my-building-block/schema.json>,
<https://ogcincubator.github.io/bblocks-examples/build/annotated/bbr/examples/my-building-block/schema.yaml> ;
bblocks:scope <http://www.opengis.net/def/bblocks/scope/unstable> ;
bblocks:status <http://www.opengis.net/def/status/invalid> .
bblocks:status <http://www.opengis.net/def/status/under-development> .

<https://example.com/sources/1> rdfs:label "Sample source document" .

<https://www.opengis.net/def/bblocks> a skos:ConceptScheme ;
skos:prefLabel "OGC Building Blocks Register" .

[] a prov:Activity ;
prov:endedAtTime "2023-10-30T15:41:22.423473"^^xsd:dateTime ;
prov:startedAtTime "2023-10-30T15:41:22.349486"^^xsd:dateTime ;
prov:endedAtTime "2024-01-09T17:42:52.376884"^^xsd:dateTime ;
prov:startedAtTime "2024-01-09T17:42:52.317133"^^xsd:dateTime ;
prov:used [ a prov:Entity ;
dct:format "application/yaml" ;
rdfs:seeAlso <file:///src/ogc/bblocks/register-context.yaml> ],
Expand All @@ -44,6 +44,6 @@ bblocks:ogc.bbr.examples.my-building-block a skos:Concept,
prov:wasAssociatedWith [ a prov:Agent,
schema:SoftwareApplication ;
rdfs:label "OGC-NA tools" ;
dct:hasVersion "0.3.19" ;
dct:hasVersion "0.3.31" ;
rdfs:seeAlso <https://github.com/opengeospatial/ogc-na-tools> ] .

Original file line number Diff line number Diff line change
@@ -1,2 +1,105 @@

{"itemIdentifier": "ogc.bbr.examples.my-building-block", "name": "My Building Block", "abstract": "This Building Block serves as a template to create new ones", "status": "invalid", "dateTimeAddition": "2023-04-05T00:00:00Z", "itemClass": "schema", "register": "ogc-building-block-register", "version": "0.1", "dateOfLastChange": "2023-04-05", "link": "https://github.com/opengeospatial/bblock-template", "sources": [{"title": "Sample source document", "link": "https://example.com/sources/1"}], "maturity": "mature", "scope": "unstable", "tags": ["templates"], "shaclRules": [], "schema": {"application/yaml": "https://ogcincubator.github.io/bblocks-examples/build/annotated/bbr/examples/my-building-block/schema.yaml", "application/json": "https://ogcincubator.github.io/bblocks-examples/build/annotated/bbr/examples/my-building-block/schema.json"}, "ldContext": "https://ogcincubator.github.io/bblocks-examples/build/annotated/bbr/examples/my-building-block/context.jsonld", "sourceFiles": "https://ogcincubator.github.io/bblocks-examples/_sources/my-building-block/", "validationPassed": false, "testOutputs": "https://github.com/ogcincubator/bblocks-examples/blob/master/build/tests/bbr/examples/my-building-block/", "description": "## Qui hastarum tectus Cithaeron iuvabat\n\nLorem markdownum vestigia sanguine rursus undis, suspenderat meo mox conlegerat\ntemperat sucos. Est graves dant sentire sanguinis flores respondent testari.\n\n> Videri vias quid Ausoniae sua flores ante, reminiscitur fuit est. Semel\n> [hectora](http://silvaque.org/) peregrinaeque rudem exercent in, Troiana si\n> Asida instabilesque somno sed.\n\n## Iam vota cui dilataque peterem\n\nTinxit lumina lacer liquidarum Aiax si mergitur sed fueris capitisque **et\ncadit** contigerant rectum [ferar](http://prosternit.com/quoque.html) temperat.\nMonet caput adsensere Ityn furentibus gelidos.", "examples": [{"title": "This is an example with just a description and no code snippets.", "content": "This is the content of the example.\n\nIn **Markdown** format."}, {"title": "Examples can have content and/or code snippets.", "content": "The content of this example. ", "snippets": [{"language": "ttl", "code": "@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n<http://example.com/my/resource> rdfs:label \"My Label\" .", "url": "https://ogcincubator.github.io/bblocks-examples/build/tests/bbr/examples/my-building-block/example_2_1.ttl"}], "transforms": [{"type": "shacl", "input-language": "text/turtle", "output-language": "text/turtle", "ref": "transforms/sample.shacl", "code": "@prefix sh: <http://www.w3.org/ns/shacl#> .\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n\n<urn:example:LabelToDCTERMS>\n a sh:NodeShape ;\n sh:targetSubjectsOf rdfs:label ;\n sh:rule [\n a sh:SPARQLRule ;\n sh:construct \"\"\"\n prefix dcterms: <http://purl.org/dc/terms/>\n prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>\n CONSTRUCT {\n $this dcterms:title ?label\n } WHERE {\n $this rdfs:label ?label\n }\n \"\"\"\n ] ;\n.", "output-extension": "ttl", "idx": 0}]}, {"title": "Transforms can be performed on uplifted snippets", "snippets": [{"language": "json", "code": "{\n \"a\": 1,\n \"b\": 2\n}\n", "url": "https://ogcincubator.github.io/bblocks-examples/build/tests/bbr/examples/my-building-block/example_3_1.json"}, {"language": "jsonld", "code": "{\n \"a\": 1,\n \"b\": 2,\n \"@context\": \"https://ogcincubator.github.io/bblocks-examples/build/annotated/bbr/examples/my-building-block/context.jsonld\"\n}", "url": "https://ogcincubator.github.io/bblocks-examples/build/tests/bbr/examples/my-building-block/example_3_1.jsonld"}, {"language": "ttl", "code": "@prefix ns1: <https://example.org/my-bb-model/> .\n@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .\n\n[] ns1:a 1 ;\n ns1:b 2 .\n\n", "url": "https://ogcincubator.github.io/bblocks-examples/build/tests/bbr/examples/my-building-block/example_3_1.ttl"}], "transforms": [{"type": "jq", "input-language": "application/json", "output-language": "application/json", "code": ".b2 = .b * .b", "output-extension": "json", "idx": 0}, {"type": "shacl", "input-language": "text/turtle", "output-language": "text/turtle", "ref": "transforms/sample2.shacl", "code": "@prefix sh: <http://www.w3.org/ns/shacl#> .\n\n<urn:example:custom>\n a sh:NodeShape ;\n sh:targetSubjectsOf <https://example.org/my-bb-model/a> ;\n sh:rule [\n a sh:SPARQLRule ;\n sh:construct \"\"\"\n CONSTRUCT {\n $this <https://example.org/my-bb-model/c> ?c\n } WHERE {\n $this <https://example.org/my-bb-model/a> ?a .\n BIND(?a + 5 AS ?c)\n }\n \"\"\"\n ] ;\n.", "output-extension": "ttl", "idx": 1}]}], "annotatedSchema": "$schema: https://json-schema.org/draft/2020-12/schema\ndescription: Schema for my building block\ntype: object\nproperties:\n a:\n type: string\n format: uri\n x-jsonld-id: https://example.org/my-bb-model/a\n x-jsonld-type: '@id'\n b:\n type: number\n x-jsonld-id: https://example.org/my-bb-model/b\nrequired:\n- a\n- b\n", "gitRepository": "https://github.com/ogcincubator/bblocks-examples", "gitPath": "_sources/my-building-block"}

{
"itemIdentifier": "ogc.bbr.examples.my-building-block",
"name": "My Building Block",
"abstract": "This Building Block serves as a template to create new ones",
"status": "under-development",
"dateTimeAddition": "2023-04-05T00:00:00Z",
"itemClass": "schema",
"register": "ogc-building-block-register",
"version": "0.1",
"dateOfLastChange": "2023-04-05",
"link": "https://github.com/opengeospatial/bblock-template",
"sources": [
{
"title": "Sample source document",
"link": "https://example.com/sources/1"
}
],
"maturity": "mature",
"scope": "unstable",
"tags": [
"templates"
],
"shaclRules": {},
"schema": {
"application/yaml": "https://ogcincubator.github.io/bblocks-examples/build/annotated/bbr/examples/my-building-block/schema.yaml",
"application/json": "https://ogcincubator.github.io/bblocks-examples/build/annotated/bbr/examples/my-building-block/schema.json"
},
"ldContext": "https://ogcincubator.github.io/bblocks-examples/build/annotated/bbr/examples/my-building-block/context.jsonld",
"sourceFiles": "https://ogcincubator.github.io/bblocks-examples/_sources/my-building-block/",
"validationPassed": false,
"testOutputs": "https://github.com/ogcincubator/bblocks-examples/blob/master/build/tests/bbr/examples/my-building-block/",
"description": "## Qui hastarum tectus Cithaeron iuvabat\n\nLorem markdownum vestigia sanguine rursus undis, suspenderat meo mox conlegerat\ntemperat sucos. Est graves dant sentire sanguinis flores respondent testari.\n\n> Videri vias quid Ausoniae sua flores ante, reminiscitur fuit est. Semel\n> [hectora](http://silvaque.org/) peregrinaeque rudem exercent in, Troiana si\n> Asida instabilesque somno sed.\n\n## Iam vota cui dilataque peterem\n\nTinxit lumina lacer liquidarum Aiax si mergitur sed fueris capitisque **et\ncadit** contigerant rectum [ferar](http://prosternit.com/quoque.html) temperat.\nMonet caput adsensere Ityn furentibus gelidos.",
"examples": [
{
"title": "This is an example with just a description and no code snippets.",
"content": "This is the content of the example.\n\nIn **Markdown** format."
},
{
"title": "Examples can have content and/or code snippets.",
"content": "The content of this example. ",
"snippets": [
{
"language": "ttl",
"code": "@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n<http://example.com/my/resource> rdfs:label \"My Label\" .",
"url": "https://ogcincubator.github.io/bblocks-examples/build/tests/bbr/examples/my-building-block/example_2_1.ttl"
}
],
"transforms": [
{
"type": "shacl",
"input-language": "text/turtle",
"output-language": "text/turtle",
"ref": "transforms/sample.shacl",
"code": "@prefix sh: <http://www.w3.org/ns/shacl#> .\n@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n\n<urn:example:LabelToDCTERMS>\n a sh:NodeShape ;\n sh:targetSubjectsOf rdfs:label ;\n sh:rule [\n a sh:SPARQLRule ;\n sh:construct \"\"\"\n prefix dcterms: <http://purl.org/dc/terms/>\n prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>\n CONSTRUCT {\n $this dcterms:title ?label\n } WHERE {\n $this rdfs:label ?label\n }\n \"\"\"\n ] ;\n.",
"output-extension": "ttl",
"idx": 0
}
]
},
{
"title": "Transforms can be performed on uplifted snippets",
"snippets": [
{
"language": "json",
"code": "{\n \"a\": 1,\n \"b\": 2\n}\n",
"url": "https://ogcincubator.github.io/bblocks-examples/build/tests/bbr/examples/my-building-block/example_3_1.json"
},
{
"language": "jsonld",
"code": "{\n \"a\": 1,\n \"b\": 2,\n \"@context\": \"https://ogcincubator.github.io/bblocks-examples/build/annotated/bbr/examples/my-building-block/context.jsonld\"\n}",
"url": "https://ogcincubator.github.io/bblocks-examples/build/tests/bbr/examples/my-building-block/example_3_1.jsonld"
},
{
"language": "ttl",
"code": "@prefix ns1: <https://example.org/my-bb-model/> .\n@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .\n\n[] ns1:a 1 ;\n ns1:b 2 .\n\n",
"url": "https://ogcincubator.github.io/bblocks-examples/build/tests/bbr/examples/my-building-block/example_3_1.ttl"
}
],
"transforms": [
{
"type": "jq",
"input-language": "application/json",
"output-language": "application/json",
"code": ".b2 = .b * .b",
"output-extension": "json",
"idx": 0
},
{
"type": "shacl",
"input-language": "text/turtle",
"output-language": "text/turtle",
"ref": "transforms/sample2.shacl",
"code": "@prefix sh: <http://www.w3.org/ns/shacl#> .\n\n<urn:example:custom>\n a sh:NodeShape ;\n sh:targetSubjectsOf <https://example.org/my-bb-model/a> ;\n sh:rule [\n a sh:SPARQLRule ;\n sh:construct \"\"\"\n CONSTRUCT {\n $this <https://example.org/my-bb-model/c> ?c\n } WHERE {\n $this <https://example.org/my-bb-model/a> ?a .\n BIND(?a + 5 AS ?c)\n }\n \"\"\"\n ] ;\n.",
"output-extension": "ttl",
"idx": 1
}
]
}
],
"annotatedSchema": "$schema: https://json-schema.org/draft/2020-12/schema\ndescription: Schema for my building block\ntype: object\nproperties:\n a:\n type: string\n format: uri\n x-jsonld-id: https://example.org/my-bb-model/a\n x-jsonld-type: '@id'\n b:\n type: number\n x-jsonld-id: https://example.org/my-bb-model/b\nrequired:\n- a\n- b\n",
"gitRepository": "https://github.com/ogcincubator/bblocks-examples",
"gitPath": "_sources/my-building-block"
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

This Building Block serves as a template to create new ones

[*Status*](http://www.opengis.net/def/status): Invalid
[*Status*](http://www.opengis.net/def/status): Under development

## Description

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,9 +285,9 @@
color: #859900;
}
</style>
<link href="../../../stylesheets/screen-fe6ad1f7.css" rel="stylesheet" media="screen" />
<link href="../../../stylesheets/screen-39090b13.css" rel="stylesheet" media="screen" />
<link href="../../../stylesheets/print-966d6edc.css" rel="stylesheet" media="print" />
<script src="../../../javascripts/all-84f5a356.js"></script>
<script src="../../../javascripts/all-a25e0d73.js"></script>

<script>
$(function() { setupCodeCopy(); });
Expand Down Expand Up @@ -368,7 +368,7 @@ <h1 id='my-building-block-ogc-bbr-examples-my-building-block'>My Building Block

<p class="status">
<span data-rainbow-uri="http://www.opengis.net/def/status">Status</span>:
<a href="http://www.opengis.net/def/status/invalid" target="_blank" data-rainbow-uri>Invalid</a>
<a href="http://www.opengis.net/def/status/under-development" target="_blank" data-rainbow-uri>Under development</a>
</p>

<aside class="warning">
Expand All @@ -391,15 +391,15 @@ <h1 id='examples'>Examples</h1><h2 id='this-is-an-example-with-just-a-descriptio
<p>This is the content of the example.</p>

<p>In <strong>Markdown</strong> format.</p>
<h2 id='examples-can-have-content-and-or-code-snippets'>Examples can have content and/or code snippets.</h2>
<p>The content of this example. </p>
<div class="highlight"><pre class="highlight turtle tab-turtle"><code><span class="kd">@prefix</span><span class="w"> </span><span class="nn">rdfs:</span><span class="w"> </span><span class="nl">&lt;http://www.w3.org/2000/01/rdf-schema#&gt;</span><span class="w"> </span><span class="p">.</span><span class="w">
<h2 id='examples-can-have-content-and-or-code-snippets'>Examples can have content and/or code snippets.</h2><div class="highlight"><pre class="highlight turtle tab-turtle"><code><span class="kd">@prefix</span><span class="w"> </span><span class="nn">rdfs:</span><span class="w"> </span><span class="nl">&lt;http://www.w3.org/2000/01/rdf-schema#&gt;</span><span class="w"> </span><span class="p">.</span><span class="w">
</span><span class="nl">&lt;http://example.com/my/resource&gt;</span><span class="w"> </span><span class="nn">rdfs:</span><span class="n">label</span><span class="w"> </span><span class="s">"My Label"</span><span class="w"> </span><span class="p">.</span><span class="w">
</span></code></pre></div>
<blockquote class="lang-specific turtle">
<p class="example-links">
<a target="_blank" href="https://ogcincubator.github.io/bblocks-examples/build/tests/bbr/examples/my-building-block/example_2_1.ttl">Open in new window</a>
</blockquote>

<p>The content of this example. </p>
<h2 id='transforms-can-be-performed-on-uplifted-snippets'>Transforms can be performed on uplifted snippets</h2><div class="highlight"><pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
</span><span class="nl">"a"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="p">,</span><span class="w">
</span><span class="nl">"b"</span><span class="p">:</span><span class="w"> </span><span class="mi">2</span><span class="w">
Expand Down
Loading

0 comments on commit 663c835

Please sign in to comment.