Class STServiceAdapter

java.lang.Object
it.uniroma2.art.semanticturkey.services.STServiceAdapter
All Implemented Interfaces:
NewerNewStyleService, STService

public class STServiceAdapter extends Object implements STService, NewerNewStyleService
Base class of Semantic Turkey services.
Author:
Manuel Fiorelli
  • Field Details

    • stServiceContext

      @Autowired protected STServiceContext stServiceContext
    • applicationEventPublisher

      @Autowired protected org.springframework.context.ApplicationEventPublisher applicationEventPublisher
    • cfManager

      @Autowired protected CustomFormManager cfManager
    • exptManager

      @Autowired protected ExtensionPointManager exptManager
  • Constructor Details

    • STServiceAdapter

      public STServiceAdapter()
  • Method Details

    • getPlatformTransactionManager

      protected org.springframework.transaction.PlatformTransactionManager getPlatformTransactionManager()
    • getProject

      public Project getProject()
    • getUserNamedGraphs

      public org.eclipse.rdf4j.model.Resource[] getUserNamedGraphs()
    • getWorkingGraph

      public org.eclipse.rdf4j.model.Resource getWorkingGraph()
    • getDeleteGraph

      public org.eclipse.rdf4j.model.Resource getDeleteGraph()
    • getMetadataGraph

      public org.eclipse.rdf4j.model.Resource getMetadataGraph()
    • getManagedConnection

      public org.eclipse.rdf4j.repository.RepositoryConnection getManagedConnection()
    • getRepository

      public org.eclipse.rdf4j.repository.Repository getRepository()
      Returns the repository for servicing a data request. This operation is aware of different mechanisms that alter the repository, e.g. version dumps.
      Returns:
    • retrieveResources

      protected Collection<AnnotatedValue<org.eclipse.rdf4j.model.Resource>> retrieveResources(String queryString)
    • createQueryBuilder

      protected QueryBuilder createQueryBuilder(String resourceQuery)
    • generateIRI

      public org.eclipse.rdf4j.model.IRI generateIRI(String xRole, Map<String,org.eclipse.rdf4j.model.Value> valueMapping) throws URIGenerationException
      Returns a new IRI for a resource. The parameter xRole holds the nature of the resource that will be identified with the given URI. Depending on the value of the parameter xRole, a conforming converter may generate differently shaped URIs, possibly using specific arguments passed via the map args.
      Parameters:
      xRole -
      valueMapping -
      Returns:
      Throws:
      URIGenerationException
    • getInitializedCodaCore

      protected it.uniroma2.art.coda.core.CODACore getInitializedCodaCore(org.eclipse.rdf4j.repository.RepositoryConnection repoConnection)
      Returns an instance of CODACore to use in services.
      Parameters:
      repoConnection -
      Returns:
      Throws:
      ProjectInconsistentException
    • getCodaLexModeForSearchFromLexicalizationModel

      protected it.uniroma2.art.coda.core.UIMACODAUtilities.LexModelForSearch getCodaLexModeForSearchFromLexicalizationModel(org.eclipse.rdf4j.model.IRI lexicalizationModel)
    • shutDownCodaCore

      protected void shutDownCodaCore(it.uniroma2.art.coda.core.CODACore codaCore)
      Stops and shutdown the instance of CODACore. This method should be called when it is finished using the instance of CODACore returned by getInitializedCodaCore(RepositoryConnection)
      Parameters:
      codaCore -
    • addValue

      protected void addValue(org.eclipse.rdf4j.repository.RepositoryConnection repoConn, org.eclipse.rdf4j.model.Resource subject, org.eclipse.rdf4j.model.IRI predicate, SpecialValue value) throws CODAException
      Throws:
      CODAException
    • updateTriplePredicate

      protected void updateTriplePredicate(org.eclipse.rdf4j.repository.RepositoryConnection repoConn, org.eclipse.rdf4j.model.Resource subject, org.eclipse.rdf4j.model.IRI predicate, org.eclipse.rdf4j.model.IRI newPredicate, org.eclipse.rdf4j.model.Value object)
    • removeReifiedValue

      protected void removeReifiedValue(org.eclipse.rdf4j.repository.RepositoryConnection repoConn, org.eclipse.rdf4j.model.Resource subject, org.eclipse.rdf4j.model.IRI predicate, org.eclipse.rdf4j.model.Resource value) throws it.uniroma2.art.coda.exception.parserexception.PRParserException
      Throws:
      it.uniroma2.art.coda.exception.parserexception.PRParserException
    • generateResourceWithCustomConstructor

      protected org.eclipse.rdf4j.model.IRI generateResourceWithCustomConstructor(org.eclipse.rdf4j.repository.RepositoryConnection repoConnection, @Nullable org.eclipse.rdf4j.model.IRI newResource, CustomFormValue customFormValue, StandardForm stdForm, org.eclipse.rdf4j.model.Model modelAdditions, org.eclipse.rdf4j.model.Model modelRemovals) throws CustomFormException, CODAException
      Initialize the new created resource (and the xLabel in case of SKOSXL lex model), by running the CF provided within the customFormValue. The updates produced by the CF execution are added to modelAdditions and modelRemovals Returns the IRI of the creating resource, which is: - generated through the CC, in case it is delegated, OR - the same provided in input (newResource) Note that if newResource is not provided and the CC is not delegated to create the resource, a runtime Exception is thrown
      Parameters:
      repoConnection -
      newResource - the resource being created. It is the one provided/generated in the calling service (e.g. createConcept, createCollection, ...) and represents the fallback IRI in case the CC is not delegated to the resource IRI creation
      customFormValue -
      stdForm -
      modelAdditions -
      modelRemovals -
      Returns:
      Throws:
      CustomFormException
      CODAException
      PrefPrefLabelClashException
      URIGenerationException
      PrefAltLabelClashException
      UnsupportedLexicalizationModelException
    • generateNatureSPARQLSelectPart

      protected String generateNatureSPARQLSelectPart()
    • generateNatureSPARQLWherePart

      protected String generateNatureSPARQLWherePart(String varName)
    • getRoleFromNature

      public static RDFResourceRole getRoleFromNature(String nature)
    • getGraphFromNature

      public static Optional<org.eclipse.rdf4j.model.IRI> getGraphFromNature(String nature)
    • instantiateSearchStrategy

      protected SearchStrategy instantiateSearchStrategy()
    • instantiateSearchStrategy

      protected SearchStrategy instantiateSearchStrategy(STRepositoryInfo.SearchStrategies searchStrategy)
    • parseReference

      protected Reference parseReference(String relativeReference)
    • publishResourceDeleted

      protected void publishResourceDeleted(org.eclipse.rdf4j.model.Resource resource, RDFResourceRole role)
    • publishResourceDeleted

      protected void publishResourceDeleted(org.eclipse.rdf4j.model.Resource resource)
    • checkNotLocallyDefined

      protected void checkNotLocallyDefined(org.eclipse.rdf4j.repository.RepositoryConnection conn, @Nullable org.eclipse.rdf4j.model.IRI resource) throws IllegalArgumentException
      This is used to manually replicate the NotLocallyDefined constraint behaviour whereas a creation service (e.g. createInstance, createProperty, ...) receives a null IRI (copied from MetadataRegistryBackendImpl
      Parameters:
      conn -
      resource -
      Throws:
      IllegalArgumentException