Class ManchesterHandler
java.lang.Object
it.uniroma2.art.semanticturkey.services.STServiceAdapter
it.uniroma2.art.semanticturkey.services.core.ManchesterHandler
- All Implemented Interfaces:
NewerNewStyleService
,STService
- Author:
- Andrea Turbati
-
Field Summary
Fields inherited from class it.uniroma2.art.semanticturkey.services.STServiceAdapter
applicationEventPublisher, cfManager, exptManager, stServiceContext
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.fasterxml.jackson.databind.JsonNode
checkDatatypeExpression
(String manchExpr) returns true if the expression is compliant with the syntax of datatype restrictions, false otherwisecom.fasterxml.jackson.databind.JsonNode
checkExpression
(String manchExpr, boolean skipSemanticCheck) returns true if the expression is compliant with the syntax, false otherwisecom.fasterxml.jackson.databind.JsonNode
checkLiteralEnumerationExpression
(String manchExpr) returns true if the expression is compliant with the syntax of Literal List restrions, false otherwisecom.fasterxml.jackson.databind.JsonNode
checkObjectPropertyExpression
(String manchExpr) returns true if the expression is compliant with the syntax of object property expressions, false otherwiseAnnotatedValue<org.eclipse.rdf4j.model.BNode>
createRestriction
(org.eclipse.rdf4j.model.IRI classIri, org.eclipse.rdf4j.model.IRI exprType, String manchExpr, boolean skipSemanticCheck) Create the restriction in the ontology (all the necessary RDf triples)getAllDLExpression
(org.eclipse.rdf4j.model.IRI classIri, boolean usePrefixes, boolean useUppercaseSyntax) returns all Manchester expression associated to the given classIRI (using owl:equivalentClassand and rdfs:subClassOf ) and the starting bnodegetExpression
(org.eclipse.rdf4j.model.BNode bnode, boolean usePrefixes, boolean useUppercaseSyntax) returns the associated Manchester expression for the given bnodeisClassAxiom
(org.eclipse.rdf4j.model.BNode bnode) return true if the bnode represents a Class Axiom, false otherwisevoid
removeExpression
(org.eclipse.rdf4j.model.IRI classIri, org.eclipse.rdf4j.model.IRI exprType, org.eclipse.rdf4j.model.BNode bnode) Remove all the RDF triples used to store the Restriction associated to the input classIRI using the specific relation (owl:equivalentClassand and rdfs:subClassOf)AnnotatedValue<org.eclipse.rdf4j.model.BNode>
updateExpression
(String newManchExpr, org.eclipse.rdf4j.model.BNode bnode, boolean skipSemanticCheck) Update the restriction by removing all the RDF triples used to store the old Restriction and then creating the new RDF triples.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
-
ManchesterHandler
public ManchesterHandler()
-
-
Method Details
-
getAllDLExpression
@STServiceOperation @Read public Map<String,Map<String, getAllDLExpressionString>> (org.eclipse.rdf4j.model.IRI classIri, @Optional(defaultValue="true") boolean usePrefixes, @Optional(defaultValue="true") boolean useUppercaseSyntax) returns all Manchester expression associated to the given classIRI (using owl:equivalentClassand and rdfs:subClassOf ) and the starting bnode- Parameters:
classIri
- the input classIRIusePrefixes
- true if the returned expression should be in qname, false for complete IRIuseUppercaseSyntax
- true if the name of the symbols used in the Manchester should be in uppercase, false for lowercase- Returns:
- a map of with two keys, equivalent and sublcass, and for each key a map of Bnode and associated Manchester Expression
-
getExpression
@STServiceOperation @Read public String getExpression(org.eclipse.rdf4j.model.BNode bnode, @Optional(defaultValue="true") boolean usePrefixes, @Optional(defaultValue="true") boolean useUppercaseSyntax) throws NotClassAxiomException returns the associated Manchester expression for the given bnode- Parameters:
bnode
- the input bnodeusePrefixes
- true if the returned expression should be in qname, false for complete IRIuseUppercaseSyntax
- true if the name of the symbols used in the Manchester should be in uppercase, false for lowercase- Returns:
- the Manchester expression associated to the given bnode
- Throws:
NotClassAxiomException
-
isClassAxiom
return true if the bnode represents a Class Axiom, false otherwise- Parameters:
bnode
- the bnode to test- Returns:
- true if the bnode represents a Class Axiom, false otherwise
-
checkExpression
@STServiceOperation @Read public com.fasterxml.jackson.databind.JsonNode checkExpression(String manchExpr, @Optional(defaultValue="false") boolean skipSemanticCheck) returns true if the expression is compliant with the syntax, false otherwise- Returns:
- true if the expression is compliant with the syntax, false otherwise
-
checkDatatypeExpression
@STServiceOperation @Read public com.fasterxml.jackson.databind.JsonNode checkDatatypeExpression(String manchExpr) returns true if the expression is compliant with the syntax of datatype restrictions, false otherwise- Returns:
- true if the expression is compliant with the syntax, false otherwise
-
checkLiteralEnumerationExpression
@STServiceOperation @Read public com.fasterxml.jackson.databind.JsonNode checkLiteralEnumerationExpression(String manchExpr) returns true if the expression is compliant with the syntax of Literal List restrions, false otherwise- Returns:
- true if the expression is compliant with the syntax, false otherwise
-
checkObjectPropertyExpression
@STServiceOperation @Read public com.fasterxml.jackson.databind.JsonNode checkObjectPropertyExpression(String manchExpr) returns true if the expression is compliant with the syntax of object property expressions, false otherwise- Returns:
- true if the expression is compliant with the syntax of object property expressions, false otherwise
-
createRestriction
@STServiceOperation(method=POST) @Write public AnnotatedValue<org.eclipse.rdf4j.model.BNode> createRestriction(org.eclipse.rdf4j.model.IRI classIri, org.eclipse.rdf4j.model.IRI exprType, String manchExpr, @Optional(defaultValue="false") boolean skipSemanticCheck) throws ManchesterParserException, ManchesterSyntacticException, ManchesterPrefixNotDefinedException, ManchesterSemanticException Create the restriction in the ontology (all the necessary RDf triples)- Parameters:
classIri
- the class which the restriction should be associated toexprType
- the property linking the classIRI to the restriction (owl:equivalentClassand or rdfs:subClassOf)manchExpr
- the Manchester expression defying the restriction- Returns:
- the newly created bnode
- Throws:
ManchesterParserException
ManchesterSyntacticException
ManchesterPrefixNotDefinedException
ManchesterSemanticException
-
removeExpression
@STServiceOperation(method=POST) @Write public void removeExpression(@Optional org.eclipse.rdf4j.model.IRI classIri, @Optional org.eclipse.rdf4j.model.IRI exprType, org.eclipse.rdf4j.model.BNode bnode) throws NotClassAxiomException Remove all the RDF triples used to store the Restriction associated to the input classIRI using the specific relation (owl:equivalentClassand and rdfs:subClassOf)- Parameters:
classIri
- (OPTIONL) the input classIRIexprType
- (OPTIONL) the relation (owl:equivalentClassand or rdfs:subClassOf) linking the Restriction to the input clasIRIbnode
- the bnode representing the restriction- Throws:
NotClassAxiomException
-
updateExpression
@STServiceOperation(method=POST) @Write public AnnotatedValue<org.eclipse.rdf4j.model.BNode> updateExpression(String newManchExpr, org.eclipse.rdf4j.model.BNode bnode, @Optional(defaultValue="false") boolean skipSemanticCheck) throws ManchesterParserException, NotClassAxiomException, ManchesterSyntacticException, ManchesterPrefixNotDefinedException, ManchesterSemanticException Update the restriction by removing all the RDF triples used to store the old Restriction and then creating the new RDF triples. It uses the same BNode as the old restriction to represent the restriction itself the input bnode- Parameters:
bnode
- the bnode representing the restriction- Returns:
- the same bnode passed in input and used to create the updated restriction
- Throws:
ManchesterParserException
NoClassDefFoundError
ManchesterSyntacticException
ManchesterPrefixNotDefinedException
NotClassAxiomException
ManchesterSemanticException
-