seebi / rdf.sh

A multi-tool shell script for doing Semantic Web jobs on the command line.
GNU General Public License v3.0
120 stars 9 forks source link

Possibility to "materialize" blank nodes #13

Closed leipert closed 6 years ago

leipert commented 6 years ago

I have a document with blank nodes. I want each blank node to be converted to a resource.

e.g.

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
<urn:example:shape>
    a sh:NodeShape ;
    sh:property [
        sh:datatype xsd:integer ;
        sh:message "ID must be a number" ;
        sh:name "ID" ;
        sh:path <urn:example:id>
    ]
.

should be converted to

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
<urn:example:shape>
    a sh:NodeShape ;
    sh:property <urn:generated:A924E218-632F-4328-8D52-EFC48D784C5D>
.

<urn:generated:A924E218-632F-4328-8D52-EFC48D784C5D>
        sh:datatype xsd:integer ;
        sh:message "ID must be a number" ;
        sh:name "ID" ;
        sh:path <urn:example:id>
.

The CLI should provide a parameter for an URI template urn:example:{uuid} where {uuid} will be replaced with an uuid. Have a look into uuidgen to generate uuid's in the command line.

Thank you for your hard work.

seebi commented 6 years ago

like it ...

seebi commented 6 years ago

useful links regarding blank nodes:

so real skolemization is out of scope I think, but also just a simple materialisation can be useful.

seebi commented 6 years ago

@leipert please validate the feature ...