Class SHACL
java.lang.Object
it.uniroma2.art.semanticturkey.services.STServiceAdapter
it.uniroma2.art.semanticturkey.services.core.SHACL
- All Implemented Interfaces:
NewerNewStyleService
,STService
This class provides services for manipulating SHACL constructs.
- Author:
- Manuel Fiorelli, 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 TypeMethodDescriptionBatch validates the repository.void
Delete existing shapes.void
exportShapes
(jakarta.servlet.http.HttpServletResponse oRes, org.eclipse.rdf4j.rio.RDFFormat rdfFormat, com.fasterxml.jackson.databind.node.ObjectNode exporterConfiguration) Exports the shapes currently stored in the SHACL Shape Graph associated with the contextual project.com.fasterxml.jackson.databind.JsonNode
extractCFfromShapeFile
(org.eclipse.rdf4j.model.IRI classIri, org.springframework.web.multipart.MultipartFile shapesFile, org.eclipse.rdf4j.rio.RDFFormat fileFormat, org.eclipse.rdf4j.model.IRI targetShape) com.fasterxml.jackson.databind.JsonNode
extractCFfromShapesGraph
(org.eclipse.rdf4j.model.IRI classIri, org.eclipse.rdf4j.model.IRI targetShape) com.fasterxml.jackson.databind.JsonNode
extractCFfromShapeURL
(org.eclipse.rdf4j.model.IRI classIri, String shape, org.eclipse.rdf4j.model.IRI targetShape, org.eclipse.rdf4j.rio.RDFFormat fileFormat) void
loadShapes
(org.springframework.web.multipart.MultipartFile shapesFile, org.eclipse.rdf4j.rio.RDFFormat fileFormat, boolean clearExisting) Loads SHACL shapes into the SHACL Shape Graph associated with the contextual project.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
-
SHACL
public SHACL()
-
-
Method Details
-
loadShapes
@STServiceOperation(method=POST) @Write @PreAuthorize("@auth.isAuthorized(\'rdf(shacl)\', \'CU\')") public void loadShapes(org.springframework.web.multipart.MultipartFile shapesFile, org.eclipse.rdf4j.rio.RDFFormat fileFormat, @Optional(defaultValue="false") boolean clearExisting) throws IOException Loads SHACL shapes into the SHACL Shape Graph associated with the contextual project. Existing shapes are deleted by default, but this behavior can be overridden.- Parameters:
shapesFile
-fileFormat
-clearExisting
-- Throws:
IOException
-
exportShapes
@STServiceOperation @Read @PreAuthorize("@auth.isAuthorized(\'rdf(shacl)\', \'R\')") public void exportShapes(jakarta.servlet.http.HttpServletResponse oRes, @Optional(defaultValue="TURTLE") org.eclipse.rdf4j.rio.RDFFormat rdfFormat, @Optional(defaultValue="{\"prettyPrint\": true, \"inlineBlankNodes\": true}") com.fasterxml.jackson.databind.node.ObjectNode exporterConfiguration) throws IllegalArgumentException, NoSuchExtensionException, WrongPropertiesException, STPropertyAccessException, InvalidConfigurationException, IOException, ReformattingException Exports the shapes currently stored in the SHACL Shape Graph associated with the contextual project. The output format is by default pretty printed TURTLE, but this behavior can be overridden. For the configuration options, please seeit.uniroma2.art.semanticturkey.extension.impl.reformattingexporter.rdfserializer.RDFSerializingExporter
- Parameters:
oRes
-rdfFormat
-exporterConfiguration
-- Throws:
ReformattingException
IOException
InvalidConfigurationException
STPropertyAccessException
WrongPropertiesException
NoSuchExtensionException
IllegalArgumentException
-
clearShapes
@STServiceOperation(method=POST) @Write @PreAuthorize("@auth.isAuthorized(\'rdf(shacl)\', \'D\')") public void clearShapes()Delete existing shapes. This operation clears the SHACL Shape Graph associated with the contextual project.- Throws:
IOException
-
batchValidation
@STServiceOperation @PreAuthorize("@auth.isAuthorized(\'rdf\', \'R\')") public String batchValidation()Batch validates the repository.- Returns:
- the SHACL validation report, describing any conformance violation
-
extractCFfromShapeFile
@STServiceOperation(method=POST) @Read public com.fasterxml.jackson.databind.JsonNode extractCFfromShapeFile(org.eclipse.rdf4j.model.IRI classIri, org.springframework.web.multipart.MultipartFile shapesFile, @Optional org.eclipse.rdf4j.rio.RDFFormat fileFormat, @Optional org.eclipse.rdf4j.model.IRI targetShape) throws IOException, OntologyManagerException, SHACLGenericException -
extractCFfromShapesGraph
@STServiceOperation(method=POST) @Read public com.fasterxml.jackson.databind.JsonNode extractCFfromShapesGraph(org.eclipse.rdf4j.model.IRI classIri, @Optional org.eclipse.rdf4j.model.IRI targetShape) throws SHACLGenericException - Throws:
SHACLGenericException
-
extractCFfromShapeURL
@STServiceOperation(method=POST) @Read public com.fasterxml.jackson.databind.JsonNode extractCFfromShapeURL(org.eclipse.rdf4j.model.IRI classIri, String shape, @Optional org.eclipse.rdf4j.model.IRI targetShape, @Optional org.eclipse.rdf4j.rio.RDFFormat fileFormat) throws IOException, OntologyManagerException, SHACLGenericException
-