RDF4J Schema Generator

Generates RDF4J Vocabulary classes from RDFS or OWL Schemas

License

License

GroupId

GroupId

com.github.ansell.rdf4j-schema-generator
ArtifactId

ArtifactId

schema-generator-parent
Last Version

Last Version

0.4.2
Release Date

Release Date

Type

Type

pom
Description

Description

RDF4J Schema Generator
Generates RDF4J Vocabulary classes from RDFS or OWL Schemas
Project URL

Project URL

https://github.com/ansell/rdf4j-schema-generator
Source Code Management

Source Code Management

https://github.com/ansell/rdf4j-schema-generator.git

Download schema-generator-parent

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.ansell.rdf4j-schema-generator/schema-generator-parent/ -->
<dependency>
    <groupId>com.github.ansell.rdf4j-schema-generator</groupId>
    <artifactId>schema-generator-parent</artifactId>
    <version>0.4.2</version>
    <type>pom</type>
</dependency>
// https://jarcasting.com/artifacts/com.github.ansell.rdf4j-schema-generator/schema-generator-parent/
implementation 'com.github.ansell.rdf4j-schema-generator:schema-generator-parent:0.4.2'
// https://jarcasting.com/artifacts/com.github.ansell.rdf4j-schema-generator/schema-generator-parent/
implementation ("com.github.ansell.rdf4j-schema-generator:schema-generator-parent:0.4.2")
'com.github.ansell.rdf4j-schema-generator:schema-generator-parent:pom:0.4.2'
<dependency org="com.github.ansell.rdf4j-schema-generator" name="schema-generator-parent" rev="0.4.2">
  <artifact name="schema-generator-parent" type="pom" />
</dependency>
@Grapes(
@Grab(group='com.github.ansell.rdf4j-schema-generator', module='schema-generator-parent', version='0.4.2')
)
libraryDependencies += "com.github.ansell.rdf4j-schema-generator" % "schema-generator-parent" % "0.4.2"
[com.github.ansell.rdf4j-schema-generator/schema-generator-parent "0.4.2"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

  • core
  • cli
  • maven-plugin

RDF4J Schema Generator

Build Status Coverage Status

RDF4J Schema Generator provides a command line tool and maven plugin that allows to create constants for RDF primitives for a given namespace from RDF ontology files.

How To

  1. Clone from https://github.com/ansell/rdf4j-schema-generator.git
  2. Run ./rdf4j-schema-generator <input-file> <output-file>
  3. Additional information can be configured using command-line parameters

Command Line Options

  <input-file>                            the input file to read from
  [<output-file>]                         the output file to write, StdOut if
                                          omitted
  -b,--languageBundles                    generate L10N LanguageBundles
  -c,--constantCase <constantCase>        case to use for URI constants,
                                          possible values: LOWER_UNDERSCORE,
                                          LOWER_CAMEL, UPPER_CAMEL,
                                          UPPER_UNDERSCORE
  -C,--stringConstantCase <constantCase>  case to use for String constants, see
                                          constantCase
  -f,--format <input-format>              mime-type of the input file (will try
                                          to guess if absent)
  -h,--help                               print this help
  -l,--language <prefLang>                preferred language for schema
                                          labels
  -n,--name <ns>                          the name of the namespace (will try to
                                          guess from the input file if absent)
  -P,--stringConstantPrefix <prefix>      prefix to create string constants
                                          (e.g. _)
  -p,--package <package>                  package declaration (will use default
                                          (empty) package if absent)
  -s,--spaces <indent>                    use spaces for indentation (tabs if
                                          missing, 4 spaces if no number given)
  -S,--stringConstantSuffix <suffix>      suffix to create string constants
                                          (e.g. _STRING)
  -u,--uri <prefix>                       the prefix for the schema (if not
                                          available in the input file)

Run from Git

Maven Plugin

<build>
    <plugins>
        <plugin>
            <groupId>com.github.ansell.rdf4j-schema-generator</groupId>
            <artifactId>schema-generator-maven-plugin</artifactId>
            <version>0.4.2</version>
            <executions>
                <execution>
                    <id>generate-schemas</id>
                    <phase>generate-sources</phase>
                    <goals>
                        <goal>generate</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <output>${project.build.directory}/generated-sources/rdf4j-schemas</output>
                <packageName>com.example.rdf4j.schemas</packageName>
                <mimeType>text/turtle</mimeType>
                <preferredLanguage>en</preferredLanguage>
                <createResourceBundles>true</createResourceBundles>
                <constantCase>UPPER_UNDERSCORE</constantCase>
                <createStringConstants>true</createStringConstants>
                <stringConstantCase>UPPER_UNDERSCORE</stringConstantCase>
                <stringConstantPrefix>_</stringConstantPrefix>
                <stringConstantSuffix>_STRING</stringConstantSuffix>
                <schemas>
                    <schema>
                        <className>LDP</className>
                        <prefix>http://www.w3.org/ns/ldp#</prefix>
                        <file>core/src/test/resources/ldp.ttl</file>
                    </schema>
                    <schema>
                        <className>RDF</className>
                        <url>http://www.w3.org/1999/02/22-rdf-syntax-ns</url>
                    </schema>
                </schemas>
            </configuration>
        </plugin>
    </plugins>
</build>
<dependencies>
    <dependency>
        <groupId>com.github.ansell.rdf4j-schema-generator</groupId>
        <artifactId>schema-generator</artifactId>
        <version>0.4.2</version>
    </dependency>
</dependencies>

Changelog

2018-11-03

  • Release 0.4.2
  • Upgrade to RDF4J-2.4.1

2017-05-25

  • Release 0.4
  • Update dependency versions

2017-04-03

  • Release 0.3
  • Add schema auto-discovery

2017-02-28

  • Release 0.2
  • Support local name string constants that are widely used
  • Support rendering templates using Freemarker for extensibility and maintenance

2017-02-24

  • Release 0.1

2017-02-23

  • Rebranded to rdf4j-schema-generator
  • Converted to use RDF4J
  • Version dropped to 0.1-SNAPSHOT for active development

Versions

Version
0.4.2
0.4.1
0.4
0.3
0.2
0.1