afs commented on code in PR #2461:
URL: https://github.com/apache/jena/pull/2461#discussion_r1597648716


##########
jena-core/src/main/java/org/apache/jena/vocabulary/OWL1.java:
##########
@@ -0,0 +1,332 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.vocabulary;
+
+import org.apache.jena.rdf.model.Property;
+import org.apache.jena.rdf.model.Resource;
+import org.apache.jena.rdf.model.ResourceFactory;
+
+/**
+ * Vocabulary definitions from file:vocabularies/owl.owl
+ */
+public class OWL1 {
+    // These will use ResourceFactory which creates Resource etc without a 
specific model.
+    // This is safer for complex initialization paths.
+    protected static Resource resource(String uri) {
+        return ResourceFactory.createResource(NS + uri);
+    }
+
+    protected static Property property(String uri) {
+        return ResourceFactory.createProperty(NS, uri);
+    }
+
+    /**
+     * The namespace of the vocabulary as a string.
+     */
+    public static final String NS = "http://www.w3.org/2002/07/owl#";;
+
+    /**
+     * The namespace of the vocabulary as a string
+     */
+    public static String getURI() {
+        return NS;
+    }
+
+    /**
+     * The namespace of the vocabulary as a resource
+     */
+    public static final Resource NAMESPACE = 
ResourceFactory.createResource(NS);
+
+    /**
+     * A resource that denotes the OWL-full sublanguage of OWL
+     */
+    public static final Resource FULL_LANG = 
ResourceFactory.createResource(getURI());
+
+    /**
+     * A resource, not officially sanctioned by WebOnt, that denotes the 
OWL-DL sublanguage of OWL
+     */
+    public static final Resource DL_LANG = 
ResourceFactory.createResource("http://www.w3.org/TR/owl-features/#term_OWLDL";);
+
+    /**
+     * A resource, not officially sanctioned by WebOnt, that denotes the 
OWL-Lite sublanguage of OWL
+     */
+    public static final Resource LITE_LANG = 
ResourceFactory.createResource("http://www.w3.org/TR/owl-features/#term_OWLLite";);
+
+    // Vocabulary properties
+    ///////////////////////////
+
+    public static final Property maxCardinality = Init.maxCardinality();
+
+    public static final Property versionInfo = Init.versionInfo();
+
+    public static final Property equivalentClass = Init.equivalentClass();
+
+    public static final Property distinctMembers = Init.distinctMembers();
+
+    public static final Property oneOf = Init.oneOf();
+
+    public static final Property sameAs = Init.sameAs();
+
+    public static final Property incompatibleWith = Init.incompatibleWith();
+
+    public static final Property minCardinality = Init.minCardinality();
+
+    public static final Property complementOf = Init.complementOf();
+
+    public static final Property onProperty = Init.onProperty();
+
+    public static final Property equivalentProperty = 
Init.equivalentProperty();
+
+    public static final Property inverseOf = Init.inverseOf();
+
+    public static final Property backwardCompatibleWith = 
Init.backwardCompatibleWith();
+
+    public static final Property differentFrom = Init.differentFrom();
+
+    public static final Property priorVersion = Init.priorVersion();
+
+    public static final Property imports = Init.imports();
+
+    public static final Property allValuesFrom = Init.allValuesFrom();
+
+    public static final Property unionOf = Init.unionOf();
+
+    public static final Property hasValue = Init.hasValue();
+
+    public static final Property someValuesFrom = Init.someValuesFrom();
+
+    public static final Property disjointWith = Init.disjointWith();
+
+    public static final Property cardinality = Init.cardinality();
+
+    public static final Property intersectionOf = Init.intersectionOf();
+
+    // Vocabulary classes
+    ///////////////////////////
+
+    public static final Resource Thing = Init.Thing();
+
+    public static final Resource DataRange = Init.DataRange();
+
+    public static final Resource Ontology = Init.Ontology();
+
+    public static final Resource DeprecatedClass = Init.DeprecatedClass();
+
+    public static final Resource AllDifferent = Init.AllDifferent();
+
+    public static final Resource DatatypeProperty = Init.DatatypeProperty();
+
+    public static final Resource SymmetricProperty = Init.SymmetricProperty();
+
+    public static final Resource TransitiveProperty = 
Init.TransitiveProperty();
+
+    public static final Resource DeprecatedProperty = 
Init.DeprecatedProperty();
+
+    public static final Resource AnnotationProperty = 
Init.AnnotationProperty();
+
+    public static final Resource Restriction = Init.Restriction();
+
+    public static final Resource Class = Init.Class();
+
+    public static final Resource OntologyProperty = Init.OntologyProperty();
+
+    public static final Resource ObjectProperty = Init.ObjectProperty();
+
+    public static final Resource FunctionalProperty = 
Init.FunctionalProperty();
+
+    public static final Resource InverseFunctionalProperty = 
Init.InverseFunctionalProperty();
+
+    public static final Resource Nothing = Init.Nothing();
+
+    // Vocabulary individuals
+    ///////////////////////////
+
+    /**
+     * OWL constants are used during Jena initialization.
+     * <p>
+     * If that initialization is triggered by touching the OWL class,
+     * then the constants are null.
+     * <p>
+     * So for these cases, call this helper class: Init.function()
+     */
+    public static class Init {

Review Comment:
   This pattern (Init inner class) should be unnecessary because initialization 
is more controlled by `ServiceLoader` and `InitJenaCore`.
   
   I tried making `Init`, class and functions, all `private static` and it 
didn't seem to cause any problems.
   
   Maybe it would be a good idea to either make this change or at least 
deprecate all uses of `Init.*` so any user code using them is warned.



##########
jena-core/src/main/java/org/apache/jena/vocabulary/XSD.java:
##########
@@ -178,6 +180,36 @@ public class XSD {
     /** Resource URI for xsd:gMonthDay */
     public static Resource gMonthDay;
 
+    /** Property URI for xsd:length */

Review Comment:
   Is "Property" the right word here? These are constraining facets, which must 
be an IRI, so maybe Property is forced.



##########
jena-core/src/main/java/org/apache/jena/vocabulary/RDF.java:
##########
@@ -59,6 +69,14 @@ public static Property li( int i )
     public static final Resource    Statement       = Init.Statement();
     public static final Resource    List            = Init.List();
     public static final Resource    nil             = Init.nil();
+    /**
+     * This property is used explicitly in facet restrictions.
+     * Also, it can be used as a literal type
+     * (e.g., {@code 'test'^^rdf:PlainLiteral}) in old ontologies based on 
RDF-1.0
+     *
+     * @see <a 
href="https://www.w3.org/TR/rdf-plain-literal";>rdf:PlainLiteral: A Datatype for 
RDF Plain Literals (Second Edition)</a>
+     */
+    public final static Resource    PlainLiteral    = Init.PlainLiteral();

Review Comment:
   rdf:PlainLiteral should never appear in RDF data!
   
   RDF plain literals should not be necessary for RDF 1.1 (all literals have a 
datatype).
   RDF 1.1 does not have RDF 1.0 "plain literals" (strings + lang tag strings).
   
   Probably worth adding this to the javadoc.
   
   (I would describe it as "archaic" these days.)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: pr-unsubscr...@jena.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscr...@jena.apache.org
For additional commands, e-mail: pr-h...@jena.apache.org

Reply via email to