RDF4J Schema Generator :: Maven Plugin

Generates RDF4J Vocabulary classes from RDFS or OWL Schemas

License

License

Categories

Categories

Maven Build Tools
GroupId

GroupId

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

ArtifactId

schema-generator-maven-plugin
Last Version

Last Version

0.4.2
Release Date

Release Date

Type

Type

maven-plugin
Description

Description

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

Download schema-generator-maven-plugin

How to add to project

<plugin>
    <groupId>com.github.ansell.rdf4j-schema-generator</groupId>
    <artifactId>schema-generator-maven-plugin</artifactId>
    <version>0.4.2</version>
</plugin>

Dependencies

compile (8)

Group / Artifact Type Version
com.github.ansell.rdf4j-schema-generator : schema-generator jar 0.4.2
org.apache.maven : maven-plugin-api jar 3.5.0
org.apache.maven.plugin-tools : maven-plugin-annotations jar 3.5
org.apache.maven : maven-core jar 3.5.0
org.sonatype.plexus : plexus-build-api jar 0.0.7
org.apache.httpcomponents : httpclient jar 4.5.6
commons-io : commons-io jar 2.6
com.googlecode.slf4j-maven-plugin-log : slf4j-maven-plugin-log jar 1.0.0

runtime (8)

Group / Artifact Type Version
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

test (1)

Group / Artifact Type Version
junit : junit jar 4.12

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