A Java library of the ontology built using OWL to Java and the OWL definition from


OWL to Java currently:

  • Builds a skeleton project


  • (a bulleted list of bugs)


  • Generate source from OWL to Java gradle task
  • Build with Java 18 and Kotlin 1.7.x
  • Generate Java 8 compatible source and Java 8 compatible library
  • Run tests in Java 8
  • Use a generate-source phase
  • Compile java source
  • Tests to validate a sample of objects
  • Automated tests to walk the object graph
  • generate in ./src/main/java and commit
  • Versioning policy, auto increment and release.
  • License dependency extraction
  • Consider progress against GitHub badges e.g.
  • Publish library Jar
  • Publish: Release 1.0.0 to GitHub packages
  • Java Docs for output
  • Automate library updates
  • Contributor guidelines
  • Library Launch: Release to Maven Central

See also


TODO: Build with tests which generate Java Sources and walk object graph:

 % git clone <owl-to-java>
 % cd <owl-to-java>
 % gradle build publishToMavenLocal  
 % cd ../libchemaorg
 % gradle build

The first 20 lines of Person Java object generated from a Parsed OWL Schema describing humanity:

 % head -20 ./build/generated-sources/uk/co/polycode/org/schema/


import java.lang.String;
import java.time.ZonedDateTime;

 * A person (alive, dead, undead, or fictional).
public class Person extends Thing {
	 * Where to find the definition of the OWL Class used to generate this Java class.
	public String isDefinedBy = "";

	 * An additional name for a Person, can be used for a middle name.
	public String additionalName;


TODO: Running the viewer from Person

\--location: Address
\--\--streetName: String
\--\--postcode: String
\--dateOfBirth: Date


libschemaorg uses Trunk based Development

An alternate branching strategy is likely to be required when there are multiple committers. While a low volume of commits and committers remains we have two paths to contribute to this project:

  • Contact me via my GitHub profile (->website -> LinkedIn) and ask to be added to this project.
  • Fork the repository then create a pull request.

Request a feature

To request a new feature:

  1. Add an item to the TODO list

(see above for paths to contribute to this project).

Add a feature

To add a new feature:

  1. Pick a feature from this
  2. Create at least one test for the feature, cut and paste the TODO list item into the test comment
  3. Build using gradle build
  4. Commit code which passes gradle clean check -PsafeBuildMode=false
  5. Get the commit hash using git rev-parse HEAD and add it to the test KDoc.


     *  The Viewer should render a Person and Address
     *  @since("Commit hash: e66cfd2dedd09bb496ac852a630ee1fb00fake00")
    fun testExpectedClassViewerOutput() {
        // truncated...


Licence – libschemaorg

libschemaorg is released under the Mozilla Public License, v. 2.0:

 * libschemaorg builds Source Code from the OWL file
 * Copyright (C) 2022  Antony Cartwright, Polycode Limited
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * Mozilla Public License, v. 2.0 for more details.

Licence –

libschemaorg uses the Schema from which is released under the Creative Commons Attribution-ShareAlike License (version 3.0): Version 14.0 is currently used and this can be downloaded from ( Release archive: ) The following files are copies of or derivatives of schemas:

./src/test/resources/schemaorg.owl - Version 14.0: copy of

Java objects generated from these files are referenced in libschemaorg source code and tests

Licence – OWL to Java

libschemaorg uses OWL to Java which released under the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at


View Github