Class OntologyManagerImpl
java.lang.Object
it.uniroma2.art.semanticturkey.ontology.impl.OntologyManagerImpl
- All Implemented Interfaces:
OntologyManager
Native implementation of
OntologyManager
for RDF4J.- Author:
- Armando Stellato, Manuel Fiorelli
-
Constructor Summary
ConstructorDescriptionOntologyManagerImpl
(Project project, String repositoryName, boolean validationEnabled) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addOntologyImportFromLocalFile
(String baseURI, String fromLocalFilePath, String toLocalFile, ImportModality modality, boolean updateImportStatement, org.eclipse.rdf4j.repository.RepositoryConnection conn, boolean validationCurrentlyEnabled, TransitiveImportMethodAllowance transitiveImportAllowance, Set<org.eclipse.rdf4j.model.IRI> failedImports, Set<org.eclipse.rdf4j.model.IRI> importedOntologies) void
addOntologyImportFromLocalFile
(org.eclipse.rdf4j.repository.RepositoryConnection conn, String baseURI, ImportModality modality, String fromLocalFilePath, String toLocalFile, TransitiveImportMethodAllowance transitiveImportAllowance, Set<org.eclipse.rdf4j.model.IRI> failedImports) Imports an ontology from a local file, and optionally copies it to the ontology mirror.void
addOntologyImportFromLocalProject
(Project sourceProject, ImportModality modality, boolean updateImportStatement, org.eclipse.rdf4j.repository.RepositoryConnection conn, boolean validationCurrentlyEnabled, TransitiveImportMethodAllowance transitiveImportAllowance, Set<org.eclipse.rdf4j.model.IRI> failedImports, Set<org.eclipse.rdf4j.model.IRI> importedOntologies) void
addOntologyImportFromLocalProject
(org.eclipse.rdf4j.repository.RepositoryConnection conn, ImportModality modality, Project sourceProject, TransitiveImportMethodAllowance transitiveImportAllowance, Set<org.eclipse.rdf4j.model.IRI> failedImports) Imports an ontology from a local projectvoid
addOntologyImportFromMirror
(String baseURI, String mirFileString, ImportModality modality, boolean updateImportStatement, org.eclipse.rdf4j.repository.RepositoryConnection conn, boolean validationCurrentlyEnabled, TransitiveImportMethodAllowance transitiveImportAllowance, Set<org.eclipse.rdf4j.model.IRI> failedImports, Set<org.eclipse.rdf4j.model.IRI> importedOntologies) void
addOntologyImportFromMirror
(org.eclipse.rdf4j.repository.RepositoryConnection conn, String baseURI, ImportModality modality, String mirFileString, TransitiveImportMethodAllowance transitiveImportAllowance, Set<org.eclipse.rdf4j.model.IRI> failedImports) Imports an ontology from the ontology mirrorvoid
addOntologyImportFromWeb
(String baseURI, String sourceURL, org.eclipse.rdf4j.rio.RDFFormat rdfFormat, ImportModality modality, boolean updateImportStatement, org.eclipse.rdf4j.repository.RepositoryConnection conn, boolean validationCurrentlyEnabled, TransitiveImportMethodAllowance transitiveImportAllowance, Set<org.eclipse.rdf4j.model.IRI> failedImports, Set<org.eclipse.rdf4j.model.IRI> importedOntologies) void
addOntologyImportFromWeb
(org.eclipse.rdf4j.repository.RepositoryConnection conn, String baseURI, ImportModality modality, String sourceURL, org.eclipse.rdf4j.rio.RDFFormat rdfFormat, TransitiveImportMethodAllowance transitiveImportAllowance, Set<org.eclipse.rdf4j.model.IRI> failedImports) Imports an ontology from the webvoid
addOntologyImportFromWebToMirror
(String baseURI, String sourceURL, String toLocalFile, org.eclipse.rdf4j.rio.RDFFormat rdfFormat, ImportModality modality, boolean updateImportStatement, org.eclipse.rdf4j.repository.RepositoryConnection conn, boolean validationCurrentlyEnabled, TransitiveImportMethodAllowance transitiveImportAllowance, Set<org.eclipse.rdf4j.model.IRI> failedImports, Set<org.eclipse.rdf4j.model.IRI> importedOntologies) void
addOntologyImportFromWebToMirror
(org.eclipse.rdf4j.repository.RepositoryConnection conn, String baseURI, ImportModality modality, String sourceURL, String toLocalFile, org.eclipse.rdf4j.rio.RDFFormat rdfFormat, TransitiveImportMethodAllowance transitiveImportAllowance, Set<org.eclipse.rdf4j.model.IRI> failedImports) Imports an ontology from the web and copies it to the ontology mirrorprotected boolean
availableNG
(org.eclipse.rdf4j.repository.RepositoryConnection conn, org.eclipse.rdf4j.model.IRI ont) tells if named graphont
is present in the current ontologyvoid
Clear the managed ontologyprotected IterationSpy<org.eclipse.rdf4j.model.Statement,
org.eclipse.rdf4j.query.QueryEvaluationException> createImportsSpyingIteration
(String baseURI, InputStream in, org.eclipse.rdf4j.rio.RDFParser parser, org.eclipse.rdf4j.model.Model capturedImports) protected <T extends org.eclipse.rdf4j.common.exception.RDF4JException>
IterationSpy<org.eclipse.rdf4j.model.Statement,T> createImportsSpyingIteration
(String baseURI, org.eclipse.rdf4j.common.iteration.Iteration<org.eclipse.rdf4j.model.Statement, T> iter, org.eclipse.rdf4j.model.Model capturedImports) protected IterationSpy<org.eclipse.rdf4j.model.Statement,
org.eclipse.rdf4j.query.QueryEvaluationException> createURLImportsSpyingIteration
(String baseURI, String sourceURL, org.eclipse.rdf4j.rio.RDFFormat rdfFormat, org.eclipse.rdf4j.model.Model capturedImports) void
declareApplicationOntology
(org.eclipse.rdf4j.model.IRI ont, boolean declareImport, boolean ng, boolean ns) It can be used by ST extensions to declare use of application ontologies for supporting their functionalities.void
declareSupportOntology
(org.eclipse.rdf4j.model.IRI ont, boolean declareImport, boolean ng, boolean ns) It can be used to declare use of an ontology, the presence of which is required by the system to work properly.void
disconnectImportedOntologyFromProject
(org.eclipse.rdf4j.repository.RepositoryConnection conn, String baseURI) Disconnects an imported ontology from the source projectprotected void
doImport
(org.eclipse.rdf4j.repository.RepositoryConnection conn, boolean validationCurrentlyEnabled, ImportModality mod, TransitiveImportMethodAllowance transitiveImportAllowance, Set<org.eclipse.rdf4j.model.IRI> failedImports, Set<org.eclipse.rdf4j.model.IRI> importedOntologies, String baseURI, ImportMethod method) void
downloadImportedOntologyFromWeb
(org.eclipse.rdf4j.repository.RepositoryConnection conn, String baseURI, String altURL, org.eclipse.rdf4j.rio.RDFFormat rdfFormat, TransitiveImportMethodAllowance transitiveImportAllowance, Set<org.eclipse.rdf4j.model.IRI> failedImports) Downloads an ontology that is a failed import from the webvoid
downloadImportedOntologyFromWebToMirror
(org.eclipse.rdf4j.repository.RepositoryConnection conn, String baseURI, String altURL, String toLocalFile, org.eclipse.rdf4j.rio.RDFFormat rdfFormat, TransitiveImportMethodAllowance transitiveImportAllowance, Set<org.eclipse.rdf4j.model.IRI> failedImports) Downloads an ontology that is a failed import from the web to the ontology mirrorReturns the base URI of the managed ontologyCollection<org.eclipse.rdf4j.model.IRI>
getDeclaredImports
(org.eclipse.rdf4j.repository.RepositoryConnection conn, ImportModality mod, boolean excludeStagedRemovals) retrieves the list of imports for the givenImportModality
note that these are imports declared (it is not assured that they have been imported successfully)void
getImportedOntologyFromLocalFile
(org.eclipse.rdf4j.repository.RepositoryConnection conn, String baseURI, String fromLocalFilePath, String toLocalFile, TransitiveImportMethodAllowance transitiveImportAllowance, Set<org.eclipse.rdf4j.model.IRI> failedImports) Retrieves an ontology that is a failed import from a local file and copies it to the ontology mirrorvoid
getImportedOntologyFromLocalProject
(org.eclipse.rdf4j.repository.RepositoryConnection conn, String baseURI, Project sourceProject, TransitiveImportMethodAllowance transitiveImportAllowance, Set<org.eclipse.rdf4j.model.IRI> failedImports) Retrieves an ontology that is a failed import from a local projectvoid
getImportedOntologyFromMirror
(org.eclipse.rdf4j.repository.RepositoryConnection conn, String baseURI, TransitiveImportMethodAllowance transitiveImportAllowance, Set<org.eclipse.rdf4j.model.IRI> failedImports) Retrieves an ontology that is a failed import from the ontology mirrorgetImportStatus
(org.eclipse.rdf4j.repository.RepositoryConnection conn, String baseURI, boolean canonicalComparison) Returns the status of an ontology import.protected MirroredOntologyFile
getMirFile
(String toLocalFile, org.eclipse.rdf4j.rio.RDFFormat rdfFormat) getNSPrefixMappings
(boolean explicit) Returns the prefixed defined in the managed ontology.org.eclipse.rdf4j.rio.RDFHandler
getRDFHandlerForLoadData
(org.eclipse.rdf4j.repository.RepositoryConnection conn, String baseURI, org.eclipse.rdf4j.model.Resource graph, TransitiveImportMethodAllowance transitiveImportAllowance, Set<org.eclipse.rdf4j.model.IRI> failedImports) Returns anRDFHandler
that adds the data to the ontology being edited (i.e. it is not a read-only import of an external ontology that the working ontology depends on, but a mass add of RDF triples to the main graph of the working ontology)org.eclipse.rdf4j.repository.Repository
Returns the underlyingRepository
getUserOntologyImportTree
(org.eclipse.rdf4j.repository.RepositoryConnection conn) Returns a hierarchical representation of user ontology Imports.void
initializeMappingsPersistence
(NSPrefixMappings nsPrefixMappings) Initializes mapping persistenceboolean
Checks whetherns
is an application ontologyboolean
Checks whetherns
is a support ontologyvoid
loadOntologyData
(org.eclipse.rdf4j.repository.RepositoryConnection conn, File inputFile, String baseURI, org.eclipse.rdf4j.rio.RDFFormat format, org.eclipse.rdf4j.model.Resource graph, TransitiveImportMethodAllowance transitiveImportAllowance, Set<org.eclipse.rdf4j.model.IRI> failedImports) Adds RDF data directly to the ontology being edited (i.e. it is not a read-only import of an external ontology that the working ontology depends on, but a mass add of RDF triples to the main graph of the working ontology)void
mirrorOntology
(String baseURI, String toLocalFile) Copies an ontology to the ontology mirror.void
removeNSPrefixMapping
(String namespace, boolean checkOnlyExplicit) Removes all prefix declarations for the suppliednamespace
void
removeOntologyImport
(org.eclipse.rdf4j.repository.RepositoryConnection conn, String uriToBeRemoved) Removes an ontology importvoid
removeOntologyImport
(org.eclipse.rdf4j.repository.RepositoryConnection conn, String uriToBeRemoved, ImportModality mod) void
setBaseURI
(String baseURI) Sets the base URI of the managed ontologyvoid
setNSPrefixMapping
(String prefix, String namespace) Defines a namespace prefix.void
startOntModel
(String baseURI, File repoDir, org.eclipse.rdf4j.repository.config.RepositoryConfig supportRepoConfig) Starts the ontology managervoid
updateImportedOntologyFromLocalFile
(org.eclipse.rdf4j.repository.RepositoryConnection conn, String baseURI, String fromLocalFilePath, String toLocalFile, TransitiveImportMethodAllowance transitiveImportAllowance, Set<org.eclipse.rdf4j.model.IRI> failedImports) Updates an ontology import from a local file and copies it to the ontology mirrorvoid
updateImportedOntologyFromLocalProject
(org.eclipse.rdf4j.repository.RepositoryConnection conn, String baseURI, String projectName, TransitiveImportMethodAllowance transitiveImportAllowance, Set<org.eclipse.rdf4j.model.IRI> failedImports) Updates an ontology import from a local projectvoid
updateImportedOntologyFromMirror
(org.eclipse.rdf4j.repository.RepositoryConnection conn, String baseURI, TransitiveImportMethodAllowance transitiveImportAllowance, Set<org.eclipse.rdf4j.model.IRI> failedImports) Updates an ontology import from the ontology mirrorvoid
updateImportedOntologyFromWeb
(org.eclipse.rdf4j.repository.RepositoryConnection conn, String baseURI, String altURL, org.eclipse.rdf4j.rio.RDFFormat rdfFormat, TransitiveImportMethodAllowance transitiveImportAllowance, Set<org.eclipse.rdf4j.model.IRI> failedImports) Updates an ontology import from the webvoid
updateImportedOntologyFromWebToMirror
(org.eclipse.rdf4j.repository.RepositoryConnection conn, String baseURI, String altURL, String toLocalFile, org.eclipse.rdf4j.rio.RDFFormat rdfFormat, TransitiveImportMethodAllowance transitiveImportAllowance, Set<org.eclipse.rdf4j.model.IRI> failedImports) Updates an ontology import from the web and stores it to the ontology mirror
-
Constructor Details
-
OntologyManagerImpl
-
-
Method Details
-
getBaseURI
Description copied from interface:OntologyManager
Returns the base URI of the managed ontology- Specified by:
getBaseURI
in interfaceOntologyManager
- Returns:
-
getNSPrefixMappings
Description copied from interface:OntologyManager
Returns the prefixed defined in the managed ontology. The returnedMap
is indexed by the prefixes. If the parameterexplicit
is set totrue
, then the returnedMap
contains only prefixed explicitly set through theOntologyManager
.- Specified by:
getNSPrefixMappings
in interfaceOntologyManager
- Returns:
- Throws:
OntologyManagerException
-
addOntologyImportFromLocalFile
public void addOntologyImportFromLocalFile(org.eclipse.rdf4j.repository.RepositoryConnection conn, String baseURI, ImportModality modality, String fromLocalFilePath, String toLocalFile, TransitiveImportMethodAllowance transitiveImportAllowance, Set<org.eclipse.rdf4j.model.IRI> failedImports) throws org.eclipse.rdf4j.common.exception.RDF4JException, OntologyManagerException Description copied from interface:OntologyManager
Imports an ontology from a local file, and optionally copies it to the ontology mirror.- Specified by:
addOntologyImportFromLocalFile
in interfaceOntologyManager
- Throws:
org.eclipse.rdf4j.common.exception.RDF4JException
OntologyManagerException
-
addOntologyImportFromLocalFile
public void addOntologyImportFromLocalFile(String baseURI, String fromLocalFilePath, String toLocalFile, ImportModality modality, boolean updateImportStatement, org.eclipse.rdf4j.repository.RepositoryConnection conn, boolean validationCurrentlyEnabled, TransitiveImportMethodAllowance transitiveImportAllowance, Set<org.eclipse.rdf4j.model.IRI> failedImports, Set<org.eclipse.rdf4j.model.IRI> importedOntologies) throws OntologyManagerException - Throws:
OntologyManagerException
-
addOntologyImportFromMirror
public void addOntologyImportFromMirror(org.eclipse.rdf4j.repository.RepositoryConnection conn, String baseURI, ImportModality modality, String mirFileString, TransitiveImportMethodAllowance transitiveImportAllowance, Set<org.eclipse.rdf4j.model.IRI> failedImports) throws org.eclipse.rdf4j.common.exception.RDF4JException, OntologyManagerException Description copied from interface:OntologyManager
Imports an ontology from the ontology mirror- Specified by:
addOntologyImportFromMirror
in interfaceOntologyManager
- Throws:
org.eclipse.rdf4j.common.exception.RDF4JException
OntologyManagerException
-
addOntologyImportFromMirror
public void addOntologyImportFromMirror(String baseURI, String mirFileString, ImportModality modality, boolean updateImportStatement, org.eclipse.rdf4j.repository.RepositoryConnection conn, boolean validationCurrentlyEnabled, TransitiveImportMethodAllowance transitiveImportAllowance, Set<org.eclipse.rdf4j.model.IRI> failedImports, Set<org.eclipse.rdf4j.model.IRI> importedOntologies) throws OntologyManagerException - Throws:
OntologyManagerException
-
addOntologyImportFromWeb
public void addOntologyImportFromWeb(org.eclipse.rdf4j.repository.RepositoryConnection conn, String baseURI, ImportModality modality, String sourceURL, org.eclipse.rdf4j.rio.RDFFormat rdfFormat, TransitiveImportMethodAllowance transitiveImportAllowance, Set<org.eclipse.rdf4j.model.IRI> failedImports) throws MalformedURLException, org.eclipse.rdf4j.common.exception.RDF4JException, OntologyManagerException Description copied from interface:OntologyManager
Imports an ontology from the web- Specified by:
addOntologyImportFromWeb
in interfaceOntologyManager
- Throws:
MalformedURLException
org.eclipse.rdf4j.common.exception.RDF4JException
OntologyManagerException
-
addOntologyImportFromWeb
public void addOntologyImportFromWeb(String baseURI, String sourceURL, org.eclipse.rdf4j.rio.RDFFormat rdfFormat, ImportModality modality, boolean updateImportStatement, org.eclipse.rdf4j.repository.RepositoryConnection conn, boolean validationCurrentlyEnabled, TransitiveImportMethodAllowance transitiveImportAllowance, Set<org.eclipse.rdf4j.model.IRI> failedImports, Set<org.eclipse.rdf4j.model.IRI> importedOntologies) throws OntologyManagerException - Throws:
OntologyManagerException
-
addOntologyImportFromWebToMirror
public void addOntologyImportFromWebToMirror(org.eclipse.rdf4j.repository.RepositoryConnection conn, String baseURI, ImportModality modality, String sourceURL, String toLocalFile, org.eclipse.rdf4j.rio.RDFFormat rdfFormat, TransitiveImportMethodAllowance transitiveImportAllowance, Set<org.eclipse.rdf4j.model.IRI> failedImports) throws MalformedURLException, org.eclipse.rdf4j.common.exception.RDF4JException, OntologyManagerException Description copied from interface:OntologyManager
Imports an ontology from the web and copies it to the ontology mirror- Specified by:
addOntologyImportFromWebToMirror
in interfaceOntologyManager
modality
- TODO- Throws:
MalformedURLException
org.eclipse.rdf4j.common.exception.RDF4JException
OntologyManagerException
-
addOntologyImportFromLocalProject
public void addOntologyImportFromLocalProject(org.eclipse.rdf4j.repository.RepositoryConnection conn, ImportModality modality, Project sourceProject, TransitiveImportMethodAllowance transitiveImportAllowance, Set<org.eclipse.rdf4j.model.IRI> failedImports) throws MalformedURLException, org.eclipse.rdf4j.common.exception.RDF4JException, OntologyManagerException Description copied from interface:OntologyManager
Imports an ontology from a local project- Specified by:
addOntologyImportFromLocalProject
in interfaceOntologyManager
modality
- TODO- Throws:
MalformedURLException
org.eclipse.rdf4j.common.exception.RDF4JException
OntologyManagerException
-
disconnectImportedOntologyFromProject
public void disconnectImportedOntologyFromProject(org.eclipse.rdf4j.repository.RepositoryConnection conn, String baseURI) throws OntologyManagerException Description copied from interface:OntologyManager
Disconnects an imported ontology from the source project- Specified by:
disconnectImportedOntologyFromProject
in interfaceOntologyManager
- Throws:
OntologyManagerException
-
addOntologyImportFromLocalProject
public void addOntologyImportFromLocalProject(Project sourceProject, ImportModality modality, boolean updateImportStatement, org.eclipse.rdf4j.repository.RepositoryConnection conn, boolean validationCurrentlyEnabled, TransitiveImportMethodAllowance transitiveImportAllowance, Set<org.eclipse.rdf4j.model.IRI> failedImports, Set<org.eclipse.rdf4j.model.IRI> importedOntologies) throws OntologyManagerException - Throws:
OntologyManagerException
-
addOntologyImportFromWebToMirror
public void addOntologyImportFromWebToMirror(String baseURI, String sourceURL, String toLocalFile, org.eclipse.rdf4j.rio.RDFFormat rdfFormat, ImportModality modality, boolean updateImportStatement, org.eclipse.rdf4j.repository.RepositoryConnection conn, boolean validationCurrentlyEnabled, TransitiveImportMethodAllowance transitiveImportAllowance, Set<org.eclipse.rdf4j.model.IRI> failedImports, Set<org.eclipse.rdf4j.model.IRI> importedOntologies) throws OntologyManagerException - Throws:
OntologyManagerException
-
getUserOntologyImportTree
public Collection<OntologyImport> getUserOntologyImportTree(org.eclipse.rdf4j.repository.RepositoryConnection conn) Description copied from interface:OntologyManager
Returns a hierarchical representation of user ontology Imports.- Specified by:
getUserOntologyImportTree
in interfaceOntologyManager
- Returns:
-
getMirFile
protected MirroredOntologyFile getMirFile(String toLocalFile, org.eclipse.rdf4j.rio.RDFFormat rdfFormat) -
createURLImportsSpyingIteration
protected IterationSpy<org.eclipse.rdf4j.model.Statement,org.eclipse.rdf4j.query.QueryEvaluationException> createURLImportsSpyingIteration(String baseURI, String sourceURL, org.eclipse.rdf4j.rio.RDFFormat rdfFormat, org.eclipse.rdf4j.model.Model capturedImports) throws MalformedURLException, IOException, org.eclipse.rdf4j.rio.UnsupportedRDFormatException, OntologyManagerException - Throws:
MalformedURLException
IOException
org.eclipse.rdf4j.rio.UnsupportedRDFormatException
OntologyManagerException
-
createImportsSpyingIteration
protected IterationSpy<org.eclipse.rdf4j.model.Statement,org.eclipse.rdf4j.query.QueryEvaluationException> createImportsSpyingIteration(String baseURI, InputStream in, org.eclipse.rdf4j.rio.RDFParser parser, org.eclipse.rdf4j.model.Model capturedImports) -
createImportsSpyingIteration
protected <T extends org.eclipse.rdf4j.common.exception.RDF4JException> IterationSpy<org.eclipse.rdf4j.model.Statement,T> createImportsSpyingIteration(String baseURI, org.eclipse.rdf4j.common.iteration.Iteration<org.eclipse.rdf4j.model.Statement, T> iter, org.eclipse.rdf4j.model.Model capturedImports) -
doImport
protected void doImport(org.eclipse.rdf4j.repository.RepositoryConnection conn, boolean validationCurrentlyEnabled, ImportModality mod, TransitiveImportMethodAllowance transitiveImportAllowance, Set<org.eclipse.rdf4j.model.IRI> failedImports, Set<org.eclipse.rdf4j.model.IRI> importedOntologies, String baseURI, ImportMethod method) throws OntologyManagerException - Throws:
OntologyManagerException
-
availableNG
protected boolean availableNG(org.eclipse.rdf4j.repository.RepositoryConnection conn, org.eclipse.rdf4j.model.IRI ont) throws org.eclipse.rdf4j.common.exception.RDF4JException tells if named graphont
is present in the current ontology- Parameters:
ont
-- Returns:
- Throws:
org.eclipse.rdf4j.common.exception.RDF4JException
-
removeOntologyImport
public void removeOntologyImport(org.eclipse.rdf4j.repository.RepositoryConnection conn, String uriToBeRemoved) throws IOException Description copied from interface:OntologyManager
Removes an ontology import- Specified by:
removeOntologyImport
in interfaceOntologyManager
- Throws:
IOException
-
removeOntologyImport
public void removeOntologyImport(org.eclipse.rdf4j.repository.RepositoryConnection conn, String uriToBeRemoved, ImportModality mod) throws IOException - Throws:
IOException
-
getImportStatus
public ImportStatus getImportStatus(org.eclipse.rdf4j.repository.RepositoryConnection conn, String baseURI, boolean canonicalComparison) Description copied from interface:OntologyManager
Returns the status of an ontology import. It is possible to indicate whether comparisons should be based on canonical names (i.e. stripping terminating #).The only relevant information isImportStatus.getValue()
- Specified by:
getImportStatus
in interfaceOntologyManager
- Returns:
-
getDeclaredImports
public Collection<org.eclipse.rdf4j.model.IRI> getDeclaredImports(org.eclipse.rdf4j.repository.RepositoryConnection conn, ImportModality mod, boolean excludeStagedRemovals) throws org.eclipse.rdf4j.common.exception.RDF4JException retrieves the list of imports for the given
ImportModality
note that these are imports declared (it is not assured that they have been imported successfully)for example,
getImportSet(ImportModality.USER)
retrieves the set of all ontology imports set by the user- Parameters:
conn
-mod
-excludeStagedRemovals
-- Returns:
- Throws:
org.eclipse.rdf4j.common.exception.RDF4JException
-
declareApplicationOntology
public void declareApplicationOntology(org.eclipse.rdf4j.model.IRI ont, boolean declareImport, boolean ng, boolean ns) Description copied from interface:OntologyManager
It can be used by ST extensions to declare use of application ontologies for supporting their functionalities. The boolean parameters can be used to declare different facets of an application ontology. If no parameter is set to, this declaration has no effect.
- Specified by:
declareApplicationOntology
in interfaceOntologyManager
declareImport
- iftrue
, declares an import with modalityImportModality.APPLICATION
.ng
- if true, this prevents triples in the namedgraph of this ontology to be shown (when ST is inuser
mode)ns
- if true, this prevents triples having a predicate with namespace matching the name of ontologyont
to be shown (again, when ST is inuser
mode)
-
declareSupportOntology
public void declareSupportOntology(org.eclipse.rdf4j.model.IRI ont, boolean declareImport, boolean ng, boolean ns) Description copied from interface:OntologyManager
It can be used to declare use of an ontology, the presence of which is required by the system to work properly. As an example, core modeling vocabularies are usually declared as such. The boolean parameters can be used to declare different facets of a support ontology. If no parameter is set to, this declaration has no effect.
- Specified by:
declareSupportOntology
in interfaceOntologyManager
declareImport
- iftrue
, declares an import with modalityImportModality.SUPPORT
.ng
- if true, this prevents triples in the namedgraph of this ontology to be shown (when ST is inuser
mode)ns
- if true, this prevents triples having a predicate with namespace matching the name of ontologyont
to be shown (again, when ST is inuser
mode)
-
downloadImportedOntologyFromWeb
public void downloadImportedOntologyFromWeb(org.eclipse.rdf4j.repository.RepositoryConnection conn, String baseURI, String altURL, org.eclipse.rdf4j.rio.RDFFormat rdfFormat, TransitiveImportMethodAllowance transitiveImportAllowance, Set<org.eclipse.rdf4j.model.IRI> failedImports) throws ImportManagementException, org.eclipse.rdf4j.common.exception.RDF4JException, IOException Description copied from interface:OntologyManager
Downloads an ontology that is a failed import from the web- Specified by:
downloadImportedOntologyFromWeb
in interfaceOntologyManager
- Throws:
ImportManagementException
org.eclipse.rdf4j.common.exception.RDF4JException
MalformedURLException
IOException
-
downloadImportedOntologyFromWebToMirror
public void downloadImportedOntologyFromWebToMirror(org.eclipse.rdf4j.repository.RepositoryConnection conn, String baseURI, String altURL, String toLocalFile, org.eclipse.rdf4j.rio.RDFFormat rdfFormat, TransitiveImportMethodAllowance transitiveImportAllowance, Set<org.eclipse.rdf4j.model.IRI> failedImports) throws ImportManagementException, org.eclipse.rdf4j.common.exception.RDF4JException, MalformedURLException, IOException Description copied from interface:OntologyManager
Downloads an ontology that is a failed import from the web to the ontology mirror- Specified by:
downloadImportedOntologyFromWebToMirror
in interfaceOntologyManager
- Throws:
ImportManagementException
org.eclipse.rdf4j.common.exception.RDF4JException
MalformedURLException
IOException
-
getImportedOntologyFromLocalFile
public void getImportedOntologyFromLocalFile(org.eclipse.rdf4j.repository.RepositoryConnection conn, String baseURI, String fromLocalFilePath, String toLocalFile, TransitiveImportMethodAllowance transitiveImportAllowance, Set<org.eclipse.rdf4j.model.IRI> failedImports) throws ImportManagementException, org.eclipse.rdf4j.common.exception.RDF4JException, IOException Description copied from interface:OntologyManager
Retrieves an ontology that is a failed import from a local file and copies it to the ontology mirror- Specified by:
getImportedOntologyFromLocalFile
in interfaceOntologyManager
- Throws:
ImportManagementException
org.eclipse.rdf4j.common.exception.RDF4JException
MalformedURLException
IOException
-
getImportedOntologyFromMirror
public void getImportedOntologyFromMirror(org.eclipse.rdf4j.repository.RepositoryConnection conn, String baseURI, TransitiveImportMethodAllowance transitiveImportAllowance, Set<org.eclipse.rdf4j.model.IRI> failedImports) throws ImportManagementException, org.eclipse.rdf4j.common.exception.RDF4JException, IOException Description copied from interface:OntologyManager
Retrieves an ontology that is a failed import from the ontology mirror- Specified by:
getImportedOntologyFromMirror
in interfaceOntologyManager
- Throws:
ImportManagementException
org.eclipse.rdf4j.common.exception.RDF4JException
MalformedURLException
IOException
-
getImportedOntologyFromLocalProject
public void getImportedOntologyFromLocalProject(org.eclipse.rdf4j.repository.RepositoryConnection conn, String baseURI, Project sourceProject, TransitiveImportMethodAllowance transitiveImportAllowance, Set<org.eclipse.rdf4j.model.IRI> failedImports) throws ImportManagementException, org.eclipse.rdf4j.common.exception.RDF4JException, IOException Description copied from interface:OntologyManager
Retrieves an ontology that is a failed import from a local project- Specified by:
getImportedOntologyFromLocalProject
in interfaceOntologyManager
- Throws:
org.eclipse.rdf4j.common.exception.RDF4JException
MalformedURLException
ImportManagementException
IOException
-
updateImportedOntologyFromWeb
public void updateImportedOntologyFromWeb(org.eclipse.rdf4j.repository.RepositoryConnection conn, String baseURI, String altURL, org.eclipse.rdf4j.rio.RDFFormat rdfFormat, TransitiveImportMethodAllowance transitiveImportAllowance, Set<org.eclipse.rdf4j.model.IRI> failedImports) throws MalformedURLException, ImportManagementException, org.eclipse.rdf4j.common.exception.RDF4JException, IOException Description copied from interface:OntologyManager
Updates an ontology import from the web- Specified by:
updateImportedOntologyFromWeb
in interfaceOntologyManager
- Throws:
MalformedURLException
ImportManagementException
org.eclipse.rdf4j.common.exception.RDF4JException
IOException
-
updateImportedOntologyFromWebToMirror
public void updateImportedOntologyFromWebToMirror(org.eclipse.rdf4j.repository.RepositoryConnection conn, String baseURI, String altURL, String toLocalFile, org.eclipse.rdf4j.rio.RDFFormat rdfFormat, TransitiveImportMethodAllowance transitiveImportAllowance, Set<org.eclipse.rdf4j.model.IRI> failedImports) throws ImportManagementException, org.eclipse.rdf4j.common.exception.RDF4JException, MalformedURLException, IOException Description copied from interface:OntologyManager
Updates an ontology import from the web and stores it to the ontology mirror- Specified by:
updateImportedOntologyFromWebToMirror
in interfaceOntologyManager
- Throws:
ImportManagementException
org.eclipse.rdf4j.common.exception.RDF4JException
MalformedURLException
IOException
-
updateImportedOntologyFromLocalFile
public void updateImportedOntologyFromLocalFile(org.eclipse.rdf4j.repository.RepositoryConnection conn, String baseURI, @Nullable String fromLocalFilePath, String toLocalFile, TransitiveImportMethodAllowance transitiveImportAllowance, Set<org.eclipse.rdf4j.model.IRI> failedImports) throws MalformedURLException, ImportManagementException, org.eclipse.rdf4j.common.exception.RDF4JException, IOException Description copied from interface:OntologyManager
Updates an ontology import from a local file and copies it to the ontology mirror- Specified by:
updateImportedOntologyFromLocalFile
in interfaceOntologyManager
- Throws:
MalformedURLException
ImportManagementException
org.eclipse.rdf4j.common.exception.RDF4JException
IOException
-
updateImportedOntologyFromLocalProject
public void updateImportedOntologyFromLocalProject(org.eclipse.rdf4j.repository.RepositoryConnection conn, String baseURI, String projectName, TransitiveImportMethodAllowance transitiveImportAllowance, Set<org.eclipse.rdf4j.model.IRI> failedImports) throws ImportManagementException, org.eclipse.rdf4j.common.exception.RDF4JException, IOException Description copied from interface:OntologyManager
Updates an ontology import from a local project- Specified by:
updateImportedOntologyFromLocalProject
in interfaceOntologyManager
- Throws:
ImportManagementException
org.eclipse.rdf4j.common.exception.RDF4JException
IOException
-
updateImportedOntologyFromMirror
public void updateImportedOntologyFromMirror(org.eclipse.rdf4j.repository.RepositoryConnection conn, String baseURI, TransitiveImportMethodAllowance transitiveImportAllowance, Set<org.eclipse.rdf4j.model.IRI> failedImports) throws MalformedURLException, ImportManagementException, org.eclipse.rdf4j.common.exception.RDF4JException, IOException Description copied from interface:OntologyManager
Updates an ontology import from the ontology mirror- Specified by:
updateImportedOntologyFromMirror
in interfaceOntologyManager
- Throws:
MalformedURLException
ImportManagementException
org.eclipse.rdf4j.common.exception.RDF4JException
IOException
-
isApplicationOntNamespace
Description copied from interface:OntologyManager
Checks whetherns
is an application ontology- Specified by:
isApplicationOntNamespace
in interfaceOntologyManager
- Returns:
-
isSupportOntNamespace
Description copied from interface:OntologyManager
Checks whetherns
is a support ontology- Specified by:
isSupportOntNamespace
in interfaceOntologyManager
- Returns:
-
mirrorOntology
public void mirrorOntology(String baseURI, String toLocalFile) throws ImportManagementException, OntologyManagerException Description copied from interface:OntologyManager
Copies an ontology to the ontology mirror.- Specified by:
mirrorOntology
in interfaceOntologyManager
- Throws:
ImportManagementException
OntologyManagerException
-
clearData
public void clearData() throws org.eclipse.rdf4j.common.exception.RDF4JExceptionDescription copied from interface:OntologyManager
Clear the managed ontology- Specified by:
clearData
in interfaceOntologyManager
- Throws:
org.eclipse.rdf4j.common.exception.RDF4JException
-
removeNSPrefixMapping
public void removeNSPrefixMapping(String namespace, boolean checkOnlyExplicit) throws NSPrefixMappingUpdateException Description copied from interface:OntologyManager
Removes all prefix declarations for the suppliednamespace
- Specified by:
removeNSPrefixMapping
in interfaceOntologyManager
- Throws:
NSPrefixMappingUpdateException
-
setBaseURI
Description copied from interface:OntologyManager
Sets the base URI of the managed ontology- Specified by:
setBaseURI
in interfaceOntologyManager
-
setNSPrefixMapping
public void setNSPrefixMapping(String prefix, String namespace) throws NSPrefixMappingUpdateException Description copied from interface:OntologyManager
Defines a namespace prefix. This method shouldn't be invoked explicitly by client code.- Specified by:
setNSPrefixMapping
in interfaceOntologyManager
- Throws:
NSPrefixMappingUpdateException
-
loadOntologyData
public void loadOntologyData(org.eclipse.rdf4j.repository.RepositoryConnection conn, File inputFile, String baseURI, org.eclipse.rdf4j.rio.RDFFormat format, org.eclipse.rdf4j.model.Resource graph, TransitiveImportMethodAllowance transitiveImportAllowance, Set<org.eclipse.rdf4j.model.IRI> failedImports) throws FileNotFoundException, IOException, org.eclipse.rdf4j.common.exception.RDF4JException Description copied from interface:OntologyManager
Adds RDF data directly to the ontology being edited (i.e. it is not a read-only import of an external ontology that the working ontology depends on, but a mass add of RDF triples to the main graph of the working ontology)- Specified by:
loadOntologyData
in interfaceOntologyManager
- Parameters:
conn
- a connection to the managed ontologyinputFile
- the RDF file from which RDF data is being loadedbaseURI
- the baseURI to be used when importing relative names from loaded RDF data- Throws:
FileNotFoundException
IOException
org.eclipse.rdf4j.common.exception.RDF4JException
-
getRDFHandlerForLoadData
public org.eclipse.rdf4j.rio.RDFHandler getRDFHandlerForLoadData(org.eclipse.rdf4j.repository.RepositoryConnection conn, String baseURI, org.eclipse.rdf4j.model.Resource graph, TransitiveImportMethodAllowance transitiveImportAllowance, Set<org.eclipse.rdf4j.model.IRI> failedImports) Description copied from interface:OntologyManager
Returns anRDFHandler
that adds the data to the ontology being edited (i.e. it is not a read-only import of an external ontology that the working ontology depends on, but a mass add of RDF triples to the main graph of the working ontology)- Specified by:
getRDFHandlerForLoadData
in interfaceOntologyManager
- Parameters:
conn
- a connection to the managed ontologybaseURI
- the baseURI to be used when importing relative names from loaded RDF data
-
initializeMappingsPersistence
Description copied from interface:OntologyManager
Initializes mapping persistence- Specified by:
initializeMappingsPersistence
in interfaceOntologyManager
-
getRepository
public org.eclipse.rdf4j.repository.Repository getRepository()Description copied from interface:OntologyManager
Returns the underlyingRepository
- Specified by:
getRepository
in interfaceOntologyManager
- Returns:
-
startOntModel
public void startOntModel(String baseURI, File repoDir, org.eclipse.rdf4j.repository.config.RepositoryConfig supportRepoConfig) throws OntologyManagerException Description copied from interface:OntologyManager
Starts the ontology manager- Specified by:
startOntModel
in interfaceOntologyManager
- Throws:
OntologyManagerException
-