Skip to content

Conversation

lukaskabc
Copy link
Contributor

This PR adds an option that enables the generation of Vocabulary class fields using the java.net.URI type.

The generated fields will use u_ prefix (as URI).
So, it is possible to use this option alongside the OWL-API IRI fields generation, and the generated Vocabulary class is backwards compatible.

Configuration option for Maven plugin: with-java-uris
CLI parameter: -u

The resulting Vocabulary class with both options enabled (with OWL API and with Java URIs):

import java.net.URI;
import org.semanticweb.owlapi.model.IRI;


/**
 * This class was generated by OWL2Java 2.4.4
 * 
 */
public class Vocabulary {

    public final static String ONTOLOGY_IRI_OWL2JAVA_ICS_DOT_OWL = "http://krizik.felk.cvut.cz/ontologies/owl2java-ics.owl";
    public final static String ONTOLOGY_IRI_OWL2JAVA_ONTO_DOT_OWL = "http://krizik.felk.cvut.cz/ontologies/owl2java-onto.owl";
    public final static String s_c_Thing = "http://www.w3.org/2002/07/owl#Thing";
    public final static IRI c_Thing = IRI.create(s_c_Thing);
    public final static URI u_c_Thing = URI.create(s_c_Thing);
    public final static String s_c_Agent = "http://krizik.felk.cvut.cz/ontologies/owl2java-onto.owl#Agent";
    public final static IRI c_Agent = IRI.create(s_c_Agent);
    public final static URI u_c_Agent = URI.create(s_c_Agent);
   // ...
}

Copy link
Contributor

@ledsoft ledsoft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

@ledsoft ledsoft merged commit 922faa2 into kbss-cvut:development Aug 4, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants