Coder Social home page Coder Social logo

shax's People

Contributors

hrennau avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

bastiion

shax's Issues

JSONSchema support?

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.

Invalid XSD generation

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.

Files

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>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.