hrennau / shax Goto Github PK
View Code? Open in Web Editor NEWA SHAX processor, transforming SHAX models into SHACL, XSD and JSON Schema.
A SHAX processor, transforming SHAX models into SHACL, XSD and JSON Schema.
I've been messing around with this tool, and I noticed that the docs mention support for generating json-schema specifications. I've tried the commands listed and checked the source, but there's nothing there to support json-schema.
Hello,
under which license shax is released ?
Thanks,
Emidio
I've been playing around with SHAX today to generate both SHACL shapes and XSD schemas, but the XSD that is generated is invalid. The name
attribute cannot contain :
, but also rdfs:label
does not really exists in 'XSD'-land. This could also be a modelling issue, but so, how should one model the (rdfs:)label
property such that it is an rdfs:label
in RDF-land.
SHAX:
<shax:model defaultCard="1" xmlns:shax="http://shax.org/ns/model" xmlns:ex="http://example.com/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:rdfs="https://www.w3.org/2000/01/rdf-schema">
<shax:property name="ex:Student" type="ex:StudentType"/>
<shax:objectType name="ex:StudentType" class="ex:Student">
<rdfs:label />
<ex:plays card="+" type="ex:SportType"/>
</shax:objectType>
<shax:objectType name="ex:SportType" class="ex:Sport">
<rdfs:label />
</shax:objectType>
</shax:model>
generated SHACL:
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix shax: <http://shax.org/ns/model#> .
@prefix nons: <http://shax.org/ns/nonamespace#> .
@prefix e_: <http://shax.org/ns/model/element-equivalent#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix xml: <http://www.w3.org/XML/1998/namespace#> .
@prefix xs: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix ex: <http://example.com/> .
@prefix rdfs: <https://www.w3.org/2000/01/rdf-schema#> .
#
#top-level elements
#==================
#
e_:_RootResource___ex___Student
a sh:NodeShape ;
sh:targetObjectsOf ex:Student ;
sh:node ex:StudentType .
ex:StudentType
a sh:NodeShape;
sh:targetClass ex:Student;
sh:class ex:Student;
sh:property [
sh:path rdfs:label;
sh:minCount 1;
sh:maxCount 1;
];
sh:property [
sh:path ex:plays;
sh:minCount 1;
sh:node ex:SportType;
].
ex:SportType
a sh:NodeShape;
sh:targetClass ex:Sport;
sh:class ex:Sport;
sh:property [
sh:path rdfs:label;
sh:minCount 1;
sh:maxCount 1;
].
generated XSD:
<xs:schema xmlns:shax="http://shax.org/ns/model" xmlns:a="http://example.com/" xmlns:b="https://www.w3.org/2000/01/rdf-schema" xmlns:zz="http://www.ttools.org/structure" xmlns:shax_1="http://www.shax.org/ns/model" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://example.com/" elementFormDefault="qualified">
<xs:element name="Student" type="a:StudentType"/>
<xs:complexType name="StudentType">
<xs:sequence>
<xs:element name="b:label"/>
<xs:element name="plays" maxOccurs="unbounded" type="a:SportType"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="SportType">
<xs:sequence>
<xs:element name="b:label"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.