Class Metadata
java.lang.Object
it.uniroma2.art.semanticturkey.services.STServiceAdapter
it.uniroma2.art.semanticturkey.services.core.Metadata
- All Implemented Interfaces:
NewerNewStyleService
,STService
This class provides services for manipulating metadata associated with a project.
- Author:
- Manuel Fiorelli, Armando Stellato, Andrea Turbati
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Represents an individual prefix mapping. -
Field Summary
Fields inherited from class it.uniroma2.art.semanticturkey.services.STServiceAdapter
applicationEventPublisher, cfManager, exptManager, stServiceContext
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddFromLocalFile
(String baseURI, org.springframework.web.multipart.MultipartFile localFile, String mirrorFile, TransitiveImportMethodAllowance transitiveImportAllowance) Imports an ontology from a local file, and copies it to the ontology mirroraddFromLocalProject
(String projectName, TransitiveImportMethodAllowance transitiveImportAllowance) Imports an ontology from the web and copies it to the ontology mirroraddFromMirror
(String baseURI, String mirrorFile, TransitiveImportMethodAllowance transitiveImportAllowance) Imports an ontology from the ontology mirroraddFromWeb
(String baseURI, String altUrl, org.eclipse.rdf4j.rio.RDFFormat rdfFormat, TransitiveImportMethodAllowance transitiveImportAllowance) Imports an ontology from the webaddFromWebToMirror
(String baseURI, String altUrl, String mirrorFile, org.eclipse.rdf4j.rio.RDFFormat rdfFormat, TransitiveImportMethodAllowance transitiveImportAllowance) Imports an ontology from the web and copies it to the ontology mirrorvoid
changeNSPrefixMapping
(String prefix, String namespace) Changes the namespace mapping for the loaded ontology.void
disconnectFromProject
(String baseURI) Disconnects an imported ontology from the source projectdownloadFromWeb
(String baseURI, String altUrl, org.eclipse.rdf4j.rio.RDFFormat rdfFormat, TransitiveImportMethodAllowance transitiveImportAllowance) Downloads an ontology that is a failed import from the webdownloadFromWebToMirror
(String baseURI, String altUrl, String mirrorFile, org.eclipse.rdf4j.rio.RDFFormat rdfFormat, TransitiveImportMethodAllowance transitiveImportAllowance) Downloads an ontology that is a failed import from the web to the ontology mirrorexpandQName
(String qname) Expands a qname into its full form, by substituting a namespace for its prefix.Returns the base URI associated with the projectReturns the default namespace associated with the projectgetFromLocalFile
(String baseURI, org.springframework.web.multipart.MultipartFile localFile, String mirrorFile, TransitiveImportMethodAllowance transitiveImportAllowance) Retrieves an ontology that is a failed import from a local file and copies it to the ontology mirrorgetFromLocalProject
(String baseURI, String projectName, TransitiveImportMethodAllowance transitiveImportAllowance) Retrieves an ontology that is a failed import from a local projectgetFromMirror
(String baseURI, TransitiveImportMethodAllowance transitiveImportAllowance) Retrieves an ontology that is a failed import from the ontology mirrorReturns the hierarchy formed by the imports.Collection<AnnotatedValue<org.eclipse.rdf4j.model.Resource>>
Returns the named graphs in the managed ontology.getNamespaceMappings
(boolean explicit) Returns the prefix declarations in the managed ontology.protected OntologyManager
void
removeImport
(String baseURI) Removes an ontology importvoid
removeNSPrefixMapping
(String namespace, boolean checkOnlyExplicit) Removes all prefix declarations for the suppliednamespace
void
setDefaultNamespace
(String namespace) Sets the default namespace associated with the projectvoid
setNSPrefixMapping
(String prefix, String namespace) Defines a namespace prefixupdateFromLocalFile
(String baseURI, org.springframework.web.multipart.MultipartFile localFile, String mirrorFile, TransitiveImportMethodAllowance transitiveImportAllowance) Updates an ontology import from a local fileupdateFromLocalProject
(String baseURI, String projectName, TransitiveImportMethodAllowance transitiveImportAllowance) Updates an ontology from a local projectupdateFromMirror
(String baseURI, TransitiveImportMethodAllowance transitiveImportAllowance) Updates an ontology import from the ontology mirrorupdateFromWeb
(String baseURI, String altUrl, org.eclipse.rdf4j.rio.RDFFormat rdfFormat, TransitiveImportMethodAllowance transitiveImportAllowance) Updates an ontology import from the webupdateFromWebToMirror
(String baseURI, String altUrl, String mirrorFile, org.eclipse.rdf4j.rio.RDFFormat rdfFormat, TransitiveImportMethodAllowance transitiveImportAllowance) Updates an ontology import from the web and stores it to the ontology mirrorMethods inherited from class it.uniroma2.art.semanticturkey.services.STServiceAdapter
addValue, checkNotLocallyDefined, createQueryBuilder, generateIRI, generateNatureSPARQLSelectPart, generateNatureSPARQLWherePart, generateResourceWithCustomConstructor, getCodaLexModeForSearchFromLexicalizationModel, getDeleteGraph, getGraphFromNature, getInitializedCodaCore, getManagedConnection, getMetadataGraph, getOptionalProject, getPlatformTransactionManager, getProject, getRepository, getRoleFromNature, getUserNamedGraphs, getWorkingGraph, instantiateSearchStrategy, instantiateSearchStrategy, parseReference, publishResourceDeleted, publishResourceDeleted, removeReifiedValue, retrieveResources, shutDownCodaCore, updateTriplePredicate
-
Constructor Details
-
Metadata
public Metadata()
-
-
Method Details
-
getBaseURI
Returns the base URI associated with the project- Returns:
-
getDefaultNamespace
Returns the default namespace associated with the project- Returns:
-
setDefaultNamespace
@STServiceOperation(method=POST) @PreAuthorize("@auth.isAuthorized(\'pm(project, defnamespace)\', \'U\')") public void setDefaultNamespace(String namespace) throws ProjectUpdateException Sets the default namespace associated with the project- Parameters:
namespace
-- Throws:
ProjectUpdateException
-
getNamespaceMappings
@STServiceOperation public Collection<Metadata.PrefixMapping> getNamespaceMappings(@Optional(defaultValue="false") boolean explicit) throws OntologyManagerException Returns the prefix declarations in the managed ontology.- Parameters:
explicit
-- Returns:
- Throws:
OntologyManagerException
-
expandQName
@STServiceOperation @Read public String expandQName(String qname) throws IllegalArgumentException, PrefixNotDefinedException Expands a qname into its full form, by substituting a namespace for its prefix.- Parameters:
qname
-- Returns:
- Throws:
IllegalArgumentException
- if the provided qname has problems such as missing colon or undefined prefixPrefixNotDefinedException
-
setNSPrefixMapping
@STServiceOperation(method=POST) @PreAuthorize("@auth.isAuthorized(\'pm(project, prefixMapping)\', \'U\')") public void setNSPrefixMapping(String prefix, String namespace) throws NSPrefixMappingUpdateException, InvalidPrefixException Defines a namespace prefix- Parameters:
prefix
-namespace
-- Throws:
NSPrefixMappingUpdateException
InvalidPrefixException
-
changeNSPrefixMapping
@STServiceOperation(method=POST) @PreAuthorize("@auth.isAuthorized(\'pm(project, prefixMapping)\', \'U\')") public void changeNSPrefixMapping(String prefix, String namespace) throws NSPrefixMappingUpdateException, InvalidPrefixException Changes the namespace mapping for the loaded ontology. Since there is no evidence that any ontology API will ever use this (there is typically only a setNamespaceMapping method) we have not included a changeNamespaceMapping in the API and consequently we delegate here setNamespaceMapping. Should this situation change, this method will require a proper implementation. -
removeNSPrefixMapping
@STServiceOperation(method=POST) @PreAuthorize("@auth.isAuthorized(\'pm(project, prefixMapping)\', \'D\')") public void removeNSPrefixMapping(String namespace, @Optional(defaultValue="true") boolean checkOnlyExplicit) throws NSPrefixMappingUpdateException Removes all prefix declarations for the suppliednamespace
- Parameters:
namespace
-checkOnlyExplicit
-- Throws:
NSPrefixMappingUpdateException
-
getNamedGraphs
@STServiceOperation @Read @PreAuthorize("@auth.isAuthorized(\'rdf(import)\', \'R\')") public Collection<AnnotatedValue<org.eclipse.rdf4j.model.Resource>> getNamedGraphs() throws org.eclipse.rdf4j.repository.RepositoryExceptionReturns the named graphs in the managed ontology.- Returns:
- Throws:
org.eclipse.rdf4j.repository.RepositoryException
-
getImports
@STServiceOperation @Read public Collection<OntologyImport> getImports() throws org.eclipse.rdf4j.repository.RepositoryExceptionReturns the hierarchy formed by the imports. Cyclic imports are identified and reported in the response- Throws:
org.eclipse.rdf4j.repository.RepositoryException
-
addFromLocalFile
@STServiceOperation(method=POST) @Write @PreAuthorize("@auth.isAuthorized(\'rdf(import)\', \'C\')") public Collection<OntologyImport> addFromLocalFile(@Optional String baseURI, org.springframework.web.multipart.MultipartFile localFile, @Optional String mirrorFile, TransitiveImportMethodAllowance transitiveImportAllowance) throws org.eclipse.rdf4j.common.exception.RDF4JException, OntologyManagerException, IOException Imports an ontology from a local file, and copies it to the ontology mirror- Parameters:
baseURI
-localFile
-mirrorFile
-transitiveImportAllowance
-- Throws:
org.eclipse.rdf4j.common.exception.RDF4JException
OntologyManagerException
IOException
-
addFromMirror
@STServiceOperation(method=POST) @Write @PreAuthorize("@auth.isAuthorized(\'rdf(import)\', \'C\')") public Collection<OntologyImport> addFromMirror(String baseURI, String mirrorFile, TransitiveImportMethodAllowance transitiveImportAllowance) throws org.eclipse.rdf4j.common.exception.RDF4JException, MalformedURLException, OntologyManagerException Imports an ontology from the ontology mirror- Parameters:
baseURI
-mirrorFile
-transitiveImportAllowance
-- Throws:
org.eclipse.rdf4j.common.exception.RDF4JException
MalformedURLException
OntologyManagerException
-
addFromWeb
@STServiceOperation(method=POST) @PreAuthorize("@auth.isAuthorized(\'rdf(import)\', \'C\')") @Write public Collection<OntologyImport> addFromWeb(String baseURI, @Optional String altUrl, @Optional org.eclipse.rdf4j.rio.RDFFormat rdfFormat, TransitiveImportMethodAllowance transitiveImportAllowance) throws org.eclipse.rdf4j.common.exception.RDF4JException, MalformedURLException, OntologyManagerException Imports an ontology from the web- Parameters:
baseURI
-altUrl
-rdfFormat
-transitiveImportAllowance
-- Throws:
org.eclipse.rdf4j.common.exception.RDF4JException
MalformedURLException
OntologyManagerException
-
addFromWebToMirror
@STServiceOperation(method=POST) @Write public Collection<OntologyImport> addFromWebToMirror(String baseURI, @Optional String altUrl, String mirrorFile, @Optional org.eclipse.rdf4j.rio.RDFFormat rdfFormat, TransitiveImportMethodAllowance transitiveImportAllowance) throws org.eclipse.rdf4j.common.exception.RDF4JException, MalformedURLException, OntologyManagerException Imports an ontology from the web and copies it to the ontology mirror- Parameters:
baseURI
-altUrl
-mirrorFile
-rdfFormat
-transitiveImportAllowance
-- Throws:
org.eclipse.rdf4j.common.exception.RDF4JException
MalformedURLException
OntologyManagerException
-
addFromLocalProject
@STServiceOperation(method=POST) @Write public Collection<OntologyImport> addFromLocalProject(String projectName, TransitiveImportMethodAllowance transitiveImportAllowance) throws org.eclipse.rdf4j.common.exception.RDF4JException, MalformedURLException, OntologyManagerException, ProjectInexistentException Imports an ontology from the web and copies it to the ontology mirror- Parameters:
projectName
-transitiveImportAllowance
-- Throws:
org.eclipse.rdf4j.common.exception.RDF4JException
MalformedURLException
OntologyManagerException
ProjectInexistentException
-
removeImport
@STServiceOperation(method=POST) @Write @PreAuthorize("@auth.isAuthorized(\'rdf(import)\', \'D\')") public void removeImport(String baseURI) throws org.eclipse.rdf4j.common.exception.RDF4JException, OntologyManagerException, IOException Removes an ontology import- Parameters:
baseURI
-- Throws:
org.eclipse.rdf4j.common.exception.RDF4JException
OntologyManagerException
IOException
-
downloadFromWeb
@STServiceOperation(method=POST) @Write @PreAuthorize("@auth.isAuthorized(\'rdf(import)\', \'C\')") public Collection<OntologyImport> downloadFromWeb(String baseURI, @Optional String altUrl, @Optional org.eclipse.rdf4j.rio.RDFFormat rdfFormat, TransitiveImportMethodAllowance transitiveImportAllowance) throws org.eclipse.rdf4j.common.exception.RDF4JException, MalformedURLException, ImportManagementException, IOException Downloads an ontology that is a failed import from the web- Parameters:
baseURI
-altUrl
-rdfFormat
-transitiveImportAllowance
-- Returns:
- Throws:
org.eclipse.rdf4j.common.exception.RDF4JException
MalformedURLException
ImportManagementException
IOException
-
downloadFromWebToMirror
@STServiceOperation(method=POST) @Write @PreAuthorize("@auth.isAuthorized(\'sys(ontologymirror)\', \'C\')") public Collection<OntologyImport> downloadFromWebToMirror(String baseURI, @Optional String altUrl, String mirrorFile, @Optional org.eclipse.rdf4j.rio.RDFFormat rdfFormat, TransitiveImportMethodAllowance transitiveImportAllowance) throws org.eclipse.rdf4j.common.exception.RDF4JException, MalformedURLException, ImportManagementException, IOException Downloads an ontology that is a failed import from the web to the ontology mirror- Parameters:
baseURI
-altUrl
-mirrorFile
-rdfFormat
-transitiveImportAllowance
-- Returns:
- Throws:
org.eclipse.rdf4j.common.exception.RDF4JException
MalformedURLException
ImportManagementException
IOException
-
getFromLocalFile
@STServiceOperation(method=POST) @Write @PreAuthorize("@auth.isAuthorized(\'rdf(import)\', \'C\')") public Collection<OntologyImport> getFromLocalFile(String baseURI, org.springframework.web.multipart.MultipartFile localFile, @Optional String mirrorFile, TransitiveImportMethodAllowance transitiveImportAllowance) throws org.eclipse.rdf4j.common.exception.RDF4JException, MalformedURLException, ImportManagementException, IOException Retrieves an ontology that is a failed import from a local file and copies it to the ontology mirror- Parameters:
baseURI
-localFile
-mirrorFile
-transitiveImportAllowance
-- Returns:
- Throws:
org.eclipse.rdf4j.common.exception.RDF4JException
MalformedURLException
ImportManagementException
IOException
-
getFromLocalProject
@STServiceOperation(method=POST) @Write @PreAuthorize("@auth.isAuthorized(\'rdf(import)\', \'C\')") public Collection<OntologyImport> getFromLocalProject(String baseURI, String projectName, TransitiveImportMethodAllowance transitiveImportAllowance) throws org.eclipse.rdf4j.common.exception.RDF4JException, OntologyManagerException, ImportManagementException, IOException, ProjectInexistentException Retrieves an ontology that is a failed import from a local project- Parameters:
projectName
-transitiveImportAllowance
-- Throws:
org.eclipse.rdf4j.common.exception.RDF4JException
MalformedURLException
OntologyManagerException
ImportManagementException
IOException
ProjectInexistentException
-
getFromMirror
@STServiceOperation(method=POST) @Write @PreAuthorize("@auth.isAuthorized(\'rdf(import)\', \'C\')") public Collection<OntologyImport> getFromMirror(String baseURI, TransitiveImportMethodAllowance transitiveImportAllowance) throws org.eclipse.rdf4j.common.exception.RDF4JException, ImportManagementException, IOException Retrieves an ontology that is a failed import from the ontology mirror- Parameters:
baseURI
-transitiveImportAllowance
-- Returns:
- Throws:
org.eclipse.rdf4j.common.exception.RDF4JException
MalformedURLException
ImportManagementException
IOException
-
updateFromWeb
@STServiceOperation(method=POST) @Write @PreAuthorize("@auth.isAuthorized(\'rdf(import)\', \'U\')") public Collection<OntologyImport> updateFromWeb(String baseURI, @Optional String altUrl, @Optional org.eclipse.rdf4j.rio.RDFFormat rdfFormat, TransitiveImportMethodAllowance transitiveImportAllowance) throws org.eclipse.rdf4j.common.exception.RDF4JException, MalformedURLException, ImportManagementException, IOException Updates an ontology import from the web- Parameters:
baseURI
-altUrl
-rdfFormat
-transitiveImportAllowance
-- Returns:
- Throws:
org.eclipse.rdf4j.common.exception.RDF4JException
MalformedURLException
ImportManagementException
IOException
-
updateFromWebToMirror
@STServiceOperation(method=POST) @Write @PreAuthorize("@auth.isAuthorized(\'sys(ontologymirror)\', \'U\')") public Collection<OntologyImport> updateFromWebToMirror(String baseURI, @Optional String altUrl, String mirrorFile, @Optional org.eclipse.rdf4j.rio.RDFFormat rdfFormat, TransitiveImportMethodAllowance transitiveImportAllowance) throws org.eclipse.rdf4j.common.exception.RDF4JException, MalformedURLException, ImportManagementException, IOException Updates an ontology import from the web and stores it to the ontology mirror- Parameters:
baseURI
-altUrl
-mirrorFile
-rdfFormat
-transitiveImportAllowance
-- Returns:
- Throws:
org.eclipse.rdf4j.common.exception.RDF4JException
MalformedURLException
ImportManagementException
IOException
-
updateFromLocalFile
@STServiceOperation(method=POST) @Write @PreAuthorize("@auth.isAuthorized(\'rdf(import)\', \'U\')") public Collection<OntologyImport> updateFromLocalFile(String baseURI, org.springframework.web.multipart.MultipartFile localFile, @Optional String mirrorFile, TransitiveImportMethodAllowance transitiveImportAllowance) throws org.eclipse.rdf4j.common.exception.RDF4JException, MalformedURLException, ImportManagementException, IOException Updates an ontology import from a local file- Parameters:
baseURI
-localFile
-mirrorFile
-transitiveImportAllowance
-- Returns:
- Throws:
org.eclipse.rdf4j.common.exception.RDF4JException
MalformedURLException
ImportManagementException
IOException
-
updateFromLocalProject
@STServiceOperation(method=POST) @Write @PreAuthorize("@auth.isAuthorized(\'rdf(import)\', \'U\')") public Collection<OntologyImport> updateFromLocalProject(String baseURI, String projectName, TransitiveImportMethodAllowance transitiveImportAllowance) throws org.eclipse.rdf4j.common.exception.RDF4JException, OntologyManagerException, ImportManagementException, IOException Updates an ontology from a local project- Parameters:
projectName
-transitiveImportAllowance
-- Throws:
org.eclipse.rdf4j.common.exception.RDF4JException
MalformedURLException
OntologyManagerException
ImportManagementException
IOException
-
updateFromMirror
@STServiceOperation(method=POST) @Write @PreAuthorize("@auth.isAuthorized(\'rdf(import)\', \'U\')") public Collection<OntologyImport> updateFromMirror(String baseURI, TransitiveImportMethodAllowance transitiveImportAllowance) throws org.eclipse.rdf4j.common.exception.RDF4JException, ImportManagementException, IOException Updates an ontology import from the ontology mirror- Parameters:
baseURI
-transitiveImportAllowance
-- Returns:
- Throws:
org.eclipse.rdf4j.common.exception.RDF4JException
MalformedURLException
ImportManagementException
IOException
-
disconnectFromProject
@STServiceOperation(method=POST) @Write @PreAuthorize("@auth.isAuthorized(\'rdf(import)\', \'U\')") public void disconnectFromProject(String baseURI) throws STPropertyAccessException Disconnects an imported ontology from the source project- Parameters:
baseURI
-- Throws:
org.eclipse.rdf4j.common.exception.RDF4JException
MalformedURLException
ImportManagementException
IOException
STPropertyAccessException
-
getOntologyManager
-