Class Classes
java.lang.Object
it.uniroma2.art.semanticturkey.services.STServiceAdapter
it.uniroma2.art.semanticturkey.services.core.Classes
- All Implemented Interfaces:
NewerNewStyleService
,STService
This class provides services for manipulating OWL/RDFS classes.
- Author:
- Manuel Fiorelli
-
Field Summary
Fields inherited from class it.uniroma2.art.semanticturkey.services.STServiceAdapter
applicationEventPublisher, cfManager, exptManager, stServiceContext
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addIntersectionOf
(org.eclipse.rdf4j.model.IRI cls, List<String> clsDescriptions) Adds the OWL.INTERSECTIONOF to the description of the classcls
using the supplied array,clsDescriptions
of Manchester expressions to generate the property values.void
Enumerates (viaowl:oneOf
) all and only members of the classcls
, which are provided by the parameterindividuals
void
addSuperCls
(org.eclipse.rdf4j.model.IRI cls, org.eclipse.rdf4j.model.IRI supercls) adds an rdfs:superClassOf relationship between two resources (already defined in the ontology)void
addUnionOf
(org.eclipse.rdf4j.model.IRI cls, List<String> clsDescriptions) Adds the OWL.UNIONOF to the description of the classcls
using the supplied array,clsDescriptions
of Manchester expressions to generate the property values.AnnotatedValue<org.eclipse.rdf4j.model.IRI>
createClass
(org.eclipse.rdf4j.model.IRI newClass, org.eclipse.rdf4j.model.IRI superClass, org.eclipse.rdf4j.model.IRI classType, CustomFormValue customFormValue) AnnotatedValue<org.eclipse.rdf4j.model.IRI>
createInstance
(org.eclipse.rdf4j.model.IRI newInstance, org.eclipse.rdf4j.model.IRI cls, CustomFormValue customFormValue) void
deleteClass
(org.eclipse.rdf4j.model.IRI cls) Deletes a classvoid
deleteInstance
(org.eclipse.rdf4j.model.IRI instance) Deletes an instanceCollection<AnnotatedValue<org.eclipse.rdf4j.model.Resource>>
getClassesInfo
(org.eclipse.rdf4j.model.IRI[] classList, boolean numInst) Returns the description of the classes in the givenclassList
.Collection<AnnotatedValue<org.eclipse.rdf4j.model.Resource>>
getInstances
(org.eclipse.rdf4j.model.IRI cls, boolean includeNonDirect) Returns the (explicit) instances of the classcls
.getNumberOfInstances
(org.eclipse.rdf4j.model.IRI cls, boolean includeNonDirect) Returns the number of instances of the given class.Collection<AnnotatedValue<org.eclipse.rdf4j.model.Resource>>
getSubClasses
(org.eclipse.rdf4j.model.IRI superClass, boolean numInst) Returns the (explicit) subclasses of the classsuperClass
.Collection<AnnotatedValue<org.eclipse.rdf4j.model.Resource>>
getSuperClasses
(org.eclipse.rdf4j.model.IRI cls) void
removeIntersectionOf
(org.eclipse.rdf4j.model.IRI cls, org.eclipse.rdf4j.model.BNode collectionBNode) Removes an axiom identified by the propertyOWL.INTERSECTIONOF
based on the collection identified bycollectionNode
from the description of the class identified bycls
.void
removeOneOf
(org.eclipse.rdf4j.model.IRI cls, org.eclipse.rdf4j.model.BNode collectionBNode) Removes the enumerationcollectionNode
from the description of the classcls
void
removeSuperCls
(org.eclipse.rdf4j.model.IRI cls, org.eclipse.rdf4j.model.IRI supercls) removes the rdfs:superClassOf relationship between two resources (already defined in the ontology)void
removeUnionOf
(org.eclipse.rdf4j.model.IRI cls, org.eclipse.rdf4j.model.BNode collectionBNode) Removes an axiom identified by the propertyOWL.UNIONOF
based on the collection identified bycollectionNode
from the description of the class identified bycls
.Methods 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
-
Classes
public Classes()
-
-
Method Details
-
getSubClasses
@STServiceOperation @Read @PreAuthorize("@auth.isAuthorized(\'rdf(cls, taxonomy)\', \'R\')") public Collection<AnnotatedValue<org.eclipse.rdf4j.model.Resource>> getSubClasses(@LocallyDefined org.eclipse.rdf4j.model.IRI superClass, @Optional(defaultValue="true") boolean numInst) Returns the (explicit) subclasses of the classsuperClass
. IfnumInst
is set totrue
, then the description of each class will contain the number of (explicit) instances.- Parameters:
superClass
-numInst
-- Returns:
-
getSuperClasses
@STServiceOperation @Read @PreAuthorize("@auth.isAuthorized(\'rdf(cls, taxonomy)\', \'R\')") public Collection<AnnotatedValue<org.eclipse.rdf4j.model.Resource>> getSuperClasses(@LocallyDefined org.eclipse.rdf4j.model.IRI cls) -
getClassesInfo
@STServiceOperation @Read @PreAuthorize("@auth.isAuthorized(\'rdf(cls)\', \'R\')") public Collection<AnnotatedValue<org.eclipse.rdf4j.model.Resource>> getClassesInfo(org.eclipse.rdf4j.model.IRI[] classList, @Optional(defaultValue="true") boolean numInst) Returns the description of the classes in the givenclassList
. IfnumInst
is set totrue
, then the description of each class will contain the number of (explicit) instances.- Parameters:
classList
-numInst
-- Returns:
-
getInstances
@STServiceOperation @Read @PreAuthorize("@auth.isAuthorized(\'rdf(cls, instances)\', \'R\')") public Collection<AnnotatedValue<org.eclipse.rdf4j.model.Resource>> getInstances(@LocallyDefined org.eclipse.rdf4j.model.IRI cls, @Optional(defaultValue="false") boolean includeNonDirect) Returns the (explicit) instances of the classcls
.- Parameters:
cls
-includeNonDirect
-- Returns:
-
getNumberOfInstances
@STServiceOperation @Read @PreAuthorize("@auth.isAuthorized(\'rdf(cls, instances)\', \'R\')") public Integer getNumberOfInstances(@LocallyDefined org.eclipse.rdf4j.model.IRI cls, @Optional(defaultValue="false") boolean includeNonDirect) Returns the number of instances of the given class. AlsogetClassesInfo(IRI[], boolean)
returns it, but it computes other info, so in case of a lot of instances it could be slow.- Parameters:
cls
-includeNonDirect
-- Returns:
-
createClass
@STServiceOperation(method=POST) @Write @PreAuthorize("@auth.isAuthorized(\'rdf(cls)\', \'C\')") public AnnotatedValue<org.eclipse.rdf4j.model.IRI> createClass(@Optional @NotLocallyDefined org.eclipse.rdf4j.model.IRI newClass, @LocallyDefined org.eclipse.rdf4j.model.IRI superClass, @Optional @LocallyDefined @SubClassOf(superClassIRI="http://www.w3.org/2000/01/rdf-schema#Class") org.eclipse.rdf4j.model.IRI classType, @Optional CustomFormValue customFormValue) throws CODAException, CustomFormException - Throws:
CODAException
CustomFormException
-
deleteClass
@STServiceOperation(method=POST) @Write @PreAuthorize("@auth.isAuthorized(\'rdf(cls)\', \'D\')") public void deleteClass(@LocallyDefined @Deleted org.eclipse.rdf4j.model.IRI cls) throws DeniedOperationException Deletes a class- Parameters:
cls
-- Throws:
DeniedOperationException
-
createInstance
@STServiceOperation(method=POST) @Write @PreAuthorize("@auth.isAuthorized(\'rdf(individual)\', \'C\')") public AnnotatedValue<org.eclipse.rdf4j.model.IRI> createInstance(@Optional @NotLocallyDefined org.eclipse.rdf4j.model.IRI newInstance, @LocallyDefined org.eclipse.rdf4j.model.IRI cls, @Optional CustomFormValue customFormValue) throws CODAException, CustomFormException - Throws:
CODAException
CustomFormException
-
deleteInstance
@STServiceOperation(method=POST) @Write @PreAuthorize("@auth.isAuthorized(\'rdf(individual)\', \'D\')") public void deleteInstance(@LocallyDefined @Deleted org.eclipse.rdf4j.model.IRI instance) Deletes an instance- Parameters:
instance
-
-
addSuperCls
@STServiceOperation(method=POST) @Write @PreAuthorize("@auth.isAuthorized(\'rdf(cls, taxonomy)\', \'C\')") public void addSuperCls(@LocallyDefined @Modified(role=cls) org.eclipse.rdf4j.model.IRI cls, @LocallyDefined org.eclipse.rdf4j.model.IRI supercls) adds an rdfs:superClassOf relationship between two resources (already defined in the ontology) -
removeSuperCls
@STServiceOperation(method=POST) @Write @PreAuthorize("@auth.isAuthorized(\'rdf(cls, taxonomy)\', \'D\')") public void removeSuperCls(@LocallyDefined @Modified(role=cls) org.eclipse.rdf4j.model.IRI cls, org.eclipse.rdf4j.model.IRI supercls) removes the rdfs:superClassOf relationship between two resources (already defined in the ontology) -
addIntersectionOf
@STServiceOperation(method=POST) @Write @PreAuthorize("@auth.isAuthorized(\'rdf(cls, taxonomy)\', \'C\')") public void addIntersectionOf(@LocallyDefined @Modified(role=cls) org.eclipse.rdf4j.model.IRI cls, List<String> clsDescriptions) throws ManchesterParserException, ManchesterSyntacticException, ManchesterPrefixNotDefinedException Adds the OWL.INTERSECTIONOF to the description of the classcls
using the supplied array,clsDescriptions
of Manchester expressions to generate the property values. InclsDescriptions
each element of the array could be a single classIRI -
removeIntersectionOf
@STServiceOperation(method=POST) @Write @PreAuthorize("@auth.isAuthorized(\'rdf(cls, taxonomy)\', \'D\')") public void removeIntersectionOf(@LocallyDefined @Modified(role=cls) org.eclipse.rdf4j.model.IRI cls, @LocallyDefined org.eclipse.rdf4j.model.BNode collectionBNode) Removes an axiom identified by the propertyOWL.INTERSECTIONOF
based on the collection identified bycollectionNode
from the description of the class identified bycls
. -
addUnionOf
@STServiceOperation(method=POST) @Write @PreAuthorize("@auth.isAuthorized(\'rdf(cls, taxonomy)\', \'C\')") public void addUnionOf(@LocallyDefined @Modified(role=cls) org.eclipse.rdf4j.model.IRI cls, List<String> clsDescriptions) throws ManchesterParserException, ManchesterSyntacticException, ManchesterPrefixNotDefinedException Adds the OWL.UNIONOF to the description of the classcls
using the supplied array,clsDescriptions
of Manchester expressions to generate the property values. InclsDescriptions
each element of the array could be a single classIRI -
removeUnionOf
@STServiceOperation(method=POST) @Write @PreAuthorize("@auth.isAuthorized(\'rdf(cls, taxonomy)\', \'D\')") public void removeUnionOf(@LocallyDefined @Modified(role=cls) org.eclipse.rdf4j.model.IRI cls, @LocallyDefined org.eclipse.rdf4j.model.BNode collectionBNode) Removes an axiom identified by the propertyOWL.UNIONOF
based on the collection identified bycollectionNode
from the description of the class identified bycls
. -
addOneOf
@STServiceOperation(method=POST) @Write @PreAuthorize("@auth.isAuthorized(\'rdf(cls, taxonomy)\', \'C\')") public void addOneOf(@LocallyDefined @Modified(role=cls) org.eclipse.rdf4j.model.IRI cls, List<org.eclipse.rdf4j.model.IRI> individuals) Enumerates (viaowl:oneOf
) all and only members of the classcls
, which are provided by the parameterindividuals
-
removeOneOf
@STServiceOperation(method=POST) @Write @PreAuthorize("@auth.isAuthorized(\'rdf(cls, taxonomy)\', \'D\')") public void removeOneOf(@LocallyDefined @Modified(role=cls) org.eclipse.rdf4j.model.IRI cls, @LocallyDefined org.eclipse.rdf4j.model.BNode collectionBNode) Removes the enumerationcollectionNode
from the description of the classcls
-