Skip to content

Commit e9ac8c5

Browse files
committed
ont-api: rename OntGraphModel -> OntModel (issue #4) + minor changes in javadocs
1 parent 6f56a55 commit e9ac8c5

File tree

161 files changed

+1535
-1526
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

161 files changed

+1535
-1526
lines changed

src/main/java/com/github/owlcs/ontapi/BaseModel.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,14 @@
1919
import com.github.owlcs.ontapi.internal.InternalModel;
2020
import com.github.owlcs.ontapi.jena.impl.conf.OntModelConfig;
2121
import com.github.owlcs.ontapi.jena.impl.conf.OntPersonality;
22+
import com.github.owlcs.ontapi.jena.model.OntModel;
2223
import org.apache.jena.graph.Graph;
2324
import org.semanticweb.owlapi.model.OWLPrimitive;
2425

2526
import java.util.Map;
2627

2728
/**
28-
* A technical interface-helper that serves as a bridge between {@link com.github.owlcs.ontapi.jena.model.OntGraphModel Jena RDF model} and
29+
* A technical interface-helper that serves as a bridge between {@link OntModel Jena RDF model} and
2930
* {@link org.semanticweb.owlapi.model.OWLOntology OWLAPI ontology} through the {@link InternalModel} on the one hand,
3031
* and between all these things and {@link org.semanticweb.owlapi.model.OWLOntologyManager OWLAPI manager}
3132
* through the {@link ModelConfig} on the other hand.

src/main/java/com/github/owlcs/ontapi/ID.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public ID() {
6868
/**
6969
* Constructs an ontology identifier from the given {@link OntID Ontology Graph Model ID}.
7070
* The difference between these two IDs ( {@link OntID} and {@link ID this classs}) is
71-
* that the former is used in the RDF representation (i.e. in {@link com.github.owlcs.ontapi.jena.model.OntGraphModel}),
71+
* that the former is used in the RDF representation (i.e. in {@link com.github.owlcs.ontapi.jena.model.OntModel}),
7272
* while the other is in the axiomatic view (i.e. in {@link org.semanticweb.owlapi.model.OWLOntology}).
7373
*
7474
* @param id {@link OntID}, not {@code null}
@@ -88,8 +88,7 @@ public ID(OntID id) {
8888
* but we have not yet learned about it
8989
* @throws NullPointerException if {@code id} is {@code null}
9090
*/
91-
protected ID(Node id, String version) throws OntApiException,
92-
IllegalStateException, UnsupportedOperationException, NullPointerException {
91+
protected ID(Node id, String version) throws OntApiException, IllegalStateException, NullPointerException {
9392
Optional<String> internalID;
9493
Optional<IRI> ontologyIRI, versionIRI;
9594
if (Objects.requireNonNull(id, "Null id node").isBlank()) {

src/main/java/com/github/owlcs/ontapi/OntBaseModelImpl.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
package com.github.owlcs.ontapi;
1616

1717
import com.github.owlcs.ontapi.internal.InternalModel;
18-
import com.github.owlcs.ontapi.jena.model.OntGraphModel;
18+
import com.github.owlcs.ontapi.jena.model.OntModel;
1919
import com.github.owlcs.ontapi.owlapi.OWLObjectImpl;
2020
import org.apache.jena.graph.Graph;
2121
import org.apache.jena.mem.GraphMem;
@@ -1107,8 +1107,8 @@ public boolean equals(@Nullable Object obj) {
11071107
if (!(obj instanceof Ontology)) {
11081108
return false;
11091109
}
1110-
OntGraphModel right = ((Ontology) obj).asGraphModel();
1111-
OntGraphModel left = getBase();
1110+
OntModel right = ((Ontology) obj).asGraphModel();
1111+
OntModel left = getBase();
11121112
return left.getID().sameAs(right.getID());
11131113
}
11141114
}

src/main/java/com/github/owlcs/ontapi/OntGraphUtils.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
import com.github.owlcs.ontapi.config.OntLoaderConfiguration;
1818
import com.github.owlcs.ontapi.jena.impl.OntIDImpl;
19-
import com.github.owlcs.ontapi.jena.model.OntGraphModel;
19+
import com.github.owlcs.ontapi.jena.model.OntModel;
2020
import com.github.owlcs.ontapi.jena.utils.Graphs;
2121
import com.github.owlcs.ontapi.jena.utils.Models;
2222
import com.github.owlcs.ontapi.transforms.GraphTransformers;
@@ -63,7 +63,7 @@
6363
*/
6464
@SuppressWarnings("WeakerAccess")
6565
public class OntGraphUtils {
66-
private static final Logger LOGGER = LoggerFactory.getLogger(OntGraphModel.class);
66+
private static final Logger LOGGER = LoggerFactory.getLogger(OntModel.class);
6767

6868
// following constants are copy-pasted from org.semanticweb.owlapi.io.DocumentSource:
6969
public static final String TEXT_PLAIN_REQUEST_TYPE = ", text/plain; q=0.1";

src/main/java/com/github/owlcs/ontapi/OntManagers.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public class OntManagers implements OWLOntologyManagerFactory {
6565
* derived from the {@link DataFactory OWL Data Factory}.
6666
* <p>
6767
* Alternative way to assembly ontology is direct working with the {@link org.apache.jena.graph.Graph Graph}
68-
* through the {@link com.github.owlcs.ontapi.jena.model.OntGraphModel} view of the ontology,
68+
* through the {@link com.github.owlcs.ontapi.jena.model.OntModel} view of the ontology,
6969
* that can be obtained using the method {@link Ontology#asGraphModel()}.
7070
* The first way of ontology editing is native for OWL-API,
7171
* the second way is native for Apache Jena and provided by ONT-API as a feature,

src/main/java/com/github/owlcs/ontapi/Ontology.java

+18-9
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,26 @@
1515
package com.github.owlcs.ontapi;
1616

1717
import com.github.owlcs.ontapi.config.AxiomsSettings;
18-
import com.github.owlcs.ontapi.jena.model.OntGraphModel;
18+
import com.github.owlcs.ontapi.jena.model.OntModel;
1919
import org.semanticweb.owlapi.model.OWLOntology;
2020

2121
/**
2222
* A Structural Ontological Model, that is an extended {@link OWLOntology OWL-API Ontology}.
2323
* It represents an <a href="http://www.w3.org/TR/owl2-syntax/#Ontologies">Ontology</a> in the OWL2 specification.
24-
* This interface provides a wide range of methods inherited from OWL-API
25-
* for working with structural (OWL Axioms and Annotations) representation of data
26-
* stored in the form of {@link org.apache.jena.graph.Graph RDF Graph}.
27-
* In addition to this range, there are also two new methods: {@link #asGraphModel()} and {@link #clearCache()}.
24+
* <p>
25+
* This interface provides access to a wide range of methods inherited from OWL-API
26+
* to work with the structural representation of data
27+
* (i.e. with OWL {@link org.semanticweb.owlapi.model.OWLAxiom Axiom}s
28+
* and Ontology Header {@link org.semanticweb.owlapi.model.OWLAnnotation Annotation}s).
29+
* Please note, in ONT-API all data is actually stored in the very {@link org.apache.jena.graph.Graph RDF Graph},
30+
* and any {@link org.semanticweb.owlapi.model.OWLAxiom Axiom} returned by this interface
31+
* is really just a special reading of the same {@link org.apache.jena.graph.Triple RDF Triple}s.
32+
* To work directly with triples-view there is the method {@link #asGraphModel()}
33+
* returning the {@link OntModel Ont[Graph]Model} view,
34+
* that is a {@link org.apache.jena.rdf.model.Model Jena Model} for OWL2.
35+
* Also, please note that although ONT-API supports the ability to change data simultaneously through both interfaces,
36+
* this is not always correct: an {@link Ontology} impls use caches,
37+
* and switching back and forth could flush these caches, which may degrade performance.
2838
* <p>
2939
* Created by szuev on 24.10.2016.
3040
*/
@@ -33,7 +43,7 @@ public interface Ontology extends OWLOntology {
3343
/**
3444
* Returns the jena model shadow,
3545
* that is an interface to work with the {@link org.apache.jena.graph.Graph RDF Graph} directly.
36-
* The {@code OntGraphModel} is backed by the {@code OntologyModel},
46+
* The {@code OntModel} is backed by the {@code Ontology},
3747
* so changes to the graph model are reflected in the structural model, and vice-versa.
3848
* <p>
3949
* Note: synchronisation is performed via different caches and graphs listeners
@@ -46,10 +56,10 @@ public interface Ontology extends OWLOntology {
4656
* Also note: any changes in the RDF-view will reset the internal cache,
4757
* that means next attempt to retrieve data from axiomatic view (i.e. list axioms) will take the same time as the very first one.
4858
*
49-
* @return {@link OntGraphModel Ontology RDF Graph Model}, not {@code null}
59+
* @return {@link OntModel Ontology RDF Graph Model}, not {@code null}
5060
* @see org.apache.jena.graph.Graph
5161
*/
52-
OntGraphModel asGraphModel();
62+
OntModel asGraphModel();
5363

5464
/**
5565
* Clears the axioms and entities cache.
@@ -79,5 +89,4 @@ public interface Ontology extends OWLOntology {
7989
* @return {@link OntologyManager} the manager for this ontology
8090
*/
8191
OntologyManager getOWLOntologyManager();
82-
8392
}

src/main/java/com/github/owlcs/ontapi/OntologyCollectionImpl.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414

1515
package com.github.owlcs.ontapi;
1616

17+
import com.github.owlcs.ontapi.jena.utils.Iter;
1718
import org.semanticweb.owlapi.model.HasOntologyID;
1819
import org.semanticweb.owlapi.model.OWLOntologyID;
19-
import com.github.owlcs.ontapi.jena.utils.Iter;
2020

2121
import java.io.Serializable;
2222
import java.util.*;
@@ -33,7 +33,7 @@
3333
* Currently it is not possible to use directly different {@code Map}s with {@link OWLOntologyID Ontology ID} as keys
3434
* like in the original OWL-API implementation,
3535
* since anything, including that ID, can be changed externally (e.g. directly from the jena graph
36-
* using shadow {@link com.github.owlcs.ontapi.jena.model.OntGraphModel} interface or something else).
36+
* using shadow {@link com.github.owlcs.ontapi.jena.model.OntModel} interface or something else).
3737
* On the other hand, it is not expected that this collection will hold a large number of elements,
3838
* so using reordering operation in every method is OK.
3939
* <p>

0 commit comments

Comments
 (0)