RDF4J Schema Generator :: Core

Generates RDF4J Vocabulary classes from RDFS or OWL Schemas

License

License

GroupId

GroupId

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

ArtifactId

schema-generator
Last Version

Last Version

0.4.2
Release Date

Release Date

Type

Type

jar
Description

Description

RDF4J Schema Generator :: Core
Generates RDF4J Vocabulary classes from RDFS or OWL Schemas

Download schema-generator

How to add to project

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

Dependencies

compile (8)

Group / Artifact Type Version
org.eclipse.rdf4j : rdf4j-model jar 2.4.1
org.eclipse.rdf4j : rdf4j-rio-api jar 2.4.1
org.apache.commons : commons-lang3 jar 3.8.1
org.apache.commons : commons-text jar 1.6
com.google.guava : guava jar 27.0-jre
org.slf4j : slf4j-api jar 1.7.25
org.freemarker : freemarker jar 2.3.28
com.github.ansell.abstract-service-loader : abstract-service-loader jar 0.5

test (11)

Group / Artifact Type Version
junit : junit jar 4.12
commons-io : commons-io jar 2.6
org.eclipse.rdf4j : rdf4j-rio-rdfxml jar 2.4.1
org.eclipse.rdf4j : rdf4j-rio-ntriples jar 2.4.1
org.eclipse.rdf4j : rdf4j-rio-nquads jar 2.4.1
org.eclipse.rdf4j : rdf4j-rio-turtle jar 2.4.1
org.eclipse.rdf4j : rdf4j-rio-trig jar 2.4.1
org.eclipse.rdf4j : rdf4j-rio-rdfjson jar 2.4.1
org.eclipse.rdf4j : rdf4j-rio-jsonld jar 2.4.1
org.semarglproject : semargl-rdf4j jar 0.7
org.slf4j : slf4j-simple jar 1.7.25

Project Modules

There are no modules declared in this project.

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