Class SKOSXL
java.lang.Object
it.uniroma2.art.semanticturkey.services.STServiceAdapter
it.uniroma2.art.semanticturkey.services.core.SKOSXL
- All Implemented Interfaces:
NewerNewStyleService
,STService
This class provides services for manipulating SKOSXL constructs.
TODO: here there are: generateConceptIRI, generateConceptSchemeIRI, generateCollectionIRI
that are implemented also in SKOS service class.
Whould be better move this method in a STSKOSServiceAdapter (that extends STServiceAdapter)?
- Author:
- Tiziano, Andrea Turbati
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class it.uniroma2.art.semanticturkey.services.STServiceAdapter
applicationEventPublisher, cfManager, exptManager, stServiceContext
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAltLabel
(org.eclipse.rdf4j.model.IRI concept, @LanguageTaggedString org.eclipse.rdf4j.model.Literal literal, org.eclipse.rdf4j.model.IRI labelCls, SKOSXL.XLabelCreationMode mode) this service adds an alternative label to a conceptvoid
addHiddenLabel
(org.eclipse.rdf4j.model.IRI concept, @LanguageTaggedString org.eclipse.rdf4j.model.Literal literal, org.eclipse.rdf4j.model.IRI labelCls, SKOSXL.XLabelCreationMode mode) this service adds an hidden label to a conceptvoid
altToPrefLabel
(org.eclipse.rdf4j.model.IRI concept, org.eclipse.rdf4j.model.Resource xlabel) void
changeLabelInfo
(org.eclipse.rdf4j.model.Resource xlabel, @LanguageTaggedString org.eclipse.rdf4j.model.Literal literal) static void
checkIfAddAltLabelIsPossible
(org.eclipse.rdf4j.repository.RepositoryConnection repoConnection, org.eclipse.rdf4j.model.Literal newLabel, org.eclipse.rdf4j.model.Resource resource) static void
checkIfAddPrefLabelIsPossible
(org.eclipse.rdf4j.repository.RepositoryConnection repoConnection, org.eclipse.rdf4j.model.Literal newLabel, boolean newResource, List<org.eclipse.rdf4j.model.IRI> conceptSchemes, RDFResourceRole rdfResourceRole) static void
checkIfPrefAltLabelClash
(org.eclipse.rdf4j.repository.RepositoryConnection repoConnection, org.eclipse.rdf4j.model.Literal newLabel, RDFResourceRole rdfResourceRole) org.eclipse.rdf4j.model.IRI
generateXLabelIRI
(org.eclipse.rdf4j.model.Resource lexicalizedResource, org.eclipse.rdf4j.model.Literal lexicalForm, org.eclipse.rdf4j.model.IRI lexicalizationProperty) Generates a new URI for a SKOSXL Label, based on the provided mandatory parameters.Collection<AnnotatedValue<org.eclipse.rdf4j.model.Resource>>
getAltLabels
(org.eclipse.rdf4j.model.IRI concept, String lang) Collection<AnnotatedValue<org.eclipse.rdf4j.model.Resource>>
getHiddenLabels
(org.eclipse.rdf4j.model.IRI concept, String lang) Collection<AnnotatedValue<org.eclipse.rdf4j.model.Resource>>
getPrefLabel
(org.eclipse.rdf4j.model.IRI concept, String lang) void
prefToAtlLabel
(org.eclipse.rdf4j.model.IRI concept, org.eclipse.rdf4j.model.Resource xlabel) void
removeAltLabel
(org.eclipse.rdf4j.model.IRI concept, org.eclipse.rdf4j.model.Resource xlabel) void
removeHiddenLabel
(org.eclipse.rdf4j.model.IRI concept, org.eclipse.rdf4j.model.Resource xlabel) void
removePrefLabel
(org.eclipse.rdf4j.model.IRI concept, org.eclipse.rdf4j.model.Resource xlabel) void
setPrefLabel
(org.eclipse.rdf4j.model.IRI concept, @LanguageTaggedString org.eclipse.rdf4j.model.Literal literal, org.eclipse.rdf4j.model.IRI labelCls, SKOSXL.XLabelCreationMode mode, boolean checkExistingAltLabel, boolean checkExistingPrefLabel) void
updateSKOSXLLexicalizationProperty
(org.eclipse.rdf4j.model.Resource subject, org.eclipse.rdf4j.model.IRI property, org.eclipse.rdf4j.model.IRI newProperty, org.eclipse.rdf4j.model.Value value) 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
-
SKOSXL
public SKOSXL()
-
-
Method Details
-
generateXLabelIRI
public org.eclipse.rdf4j.model.IRI generateXLabelIRI(org.eclipse.rdf4j.model.Resource lexicalizedResource, org.eclipse.rdf4j.model.Literal lexicalForm, org.eclipse.rdf4j.model.IRI lexicalizationProperty) throws URIGenerationException Generates a new URI for a SKOSXL Label, based on the provided mandatory parameters. The actual generation of the URI is delegated to#generateURI(String, Map)
, which in turn invokes the current binding for the extension pointURIGenerator
. In the end, the URI generator will be provided with the following:xLabel
as thexRole
- a map of additional parameters consisting of
lexicalForm
,lexicalizedResource
andtype
(each, if notnull
)
null
, but in the end is the specific implementation of the extension point that would complain about the absence of one of these theoretically mandatory parameters.- Parameters:
lexicalForm
- the textual content of the labellexicalizedResource
- the resource to which the label will be attached tolexicalizationProperty
- the property used for attaching the label- Returns:
- Throws:
URIGenerationException
-
getPrefLabel
@STServiceOperation @Read @PreAuthorize("@auth.isAuthorized(\'rdf(\' +@auth.typeof(#concept)+ \', lexicalization)\', \'R\')") public Collection<AnnotatedValue<org.eclipse.rdf4j.model.Resource>> getPrefLabel(@LocallyDefined org.eclipse.rdf4j.model.IRI concept, @Optional(defaultValue="*") String lang) -
getAltLabels
@STServiceOperation @Read @PreAuthorize("@auth.isAuthorized(\'rdf(\' +@auth.typeof(#concept)+ \', lexicalization)\', \'R\')") public Collection<AnnotatedValue<org.eclipse.rdf4j.model.Resource>> getAltLabels(@LocallyDefined org.eclipse.rdf4j.model.IRI concept, @Optional(defaultValue="*") String lang) -
getHiddenLabels
@STServiceOperation @Read @PreAuthorize("@auth.isAuthorized(\'rdf(\' +@auth.typeof(#concept)+ \', lexicalization)\', \'R\')") public Collection<AnnotatedValue<org.eclipse.rdf4j.model.Resource>> getHiddenLabels(@LocallyDefined org.eclipse.rdf4j.model.IRI concept, @Optional(defaultValue="*") String lang) -
addAltLabel
@STServiceOperation(method=POST) @Write @PreAuthorize("@auth.isAuthorized(\'rdf(\' +@auth.typeof(#concept)+ \', lexicalization)\', \'{lang: \'\'\' +@auth.langof(#literal)+ \'\'\'}\', \'C\')") @DisplayName("add alternative label") @TermCreation(label="literal", concept="concept", facet=ALT_LABEL) public void addAltLabel(@LocallyDefined @Modified org.eclipse.rdf4j.model.IRI concept, @LanguageTaggedString @LanguageTaggedString org.eclipse.rdf4j.model.Literal literal, @Optional @LocallyDefined @SubClassOf(superClassIRI="http://www.w3.org/2008/05/skos-xl#Label") org.eclipse.rdf4j.model.IRI labelCls, SKOSXL.XLabelCreationMode mode) throws URIGenerationException, AltPrefLabelClashException this service adds an alternative label to a concept- Parameters:
concept
-literal
-mode
- bnode or uri: if uri a URI generator is used to create the URI for the xlabel- Throws:
URIGenerationException
PrefPrefLabelClashException
AltPrefLabelClashException
-
addHiddenLabel
@STServiceOperation(method=POST) @Write @PreAuthorize("@auth.isAuthorized(\'rdf(\' +@auth.typeof(#concept)+ \', lexicalization)\', \'{lang: \'\'\' +@auth.langof(#literal)+ \'\'\'}\', \'C\')") @DisplayName("add hidden label") @TermCreation(label="literal", concept="concept", facet=HIDDEN_LABEL) public void addHiddenLabel(@LocallyDefined @Modified org.eclipse.rdf4j.model.IRI concept, @LanguageTaggedString @LanguageTaggedString org.eclipse.rdf4j.model.Literal literal, @Optional @LocallyDefined @SubClassOf(superClassIRI="http://www.w3.org/2008/05/skos-xl#Label") org.eclipse.rdf4j.model.IRI labelCls, SKOSXL.XLabelCreationMode mode) throws URIGenerationException this service adds an hidden label to a concept- Parameters:
concept
-literal
-mode
- bnode or uri: if uri a URI generator is used to create the URI for the xlabel- Throws:
URIGenerationException
-
prefToAtlLabel
@STServiceOperation(method=POST) @Write public void prefToAtlLabel(@LocallyDefined @Modified org.eclipse.rdf4j.model.IRI concept, @LocallyDefined org.eclipse.rdf4j.model.Resource xlabel) -
altToPrefLabel
@STServiceOperation(method=POST) @Write public void altToPrefLabel(@LocallyDefined @Modified org.eclipse.rdf4j.model.IRI concept, @LocallyDefined org.eclipse.rdf4j.model.Resource xlabel) -
setPrefLabel
@STServiceOperation(method=POST) @Write @PreAuthorize("@auth.isAuthorized(\'rdf(\' +@auth.typeof(#concept)+ \', lexicalization)\', \'{lang: \'\'\' +@auth.langof(#literal)+ \'\'\'}\', \'C\')") @DisplayName("set preferred label") @TermCreation(label="literal", concept="concept", facet=PREF_LABEL) public void setPrefLabel(@LocallyDefined @Modified org.eclipse.rdf4j.model.IRI concept, @LanguageTaggedString @LanguageTaggedString org.eclipse.rdf4j.model.Literal literal, @Optional @LocallyDefined @SubClassOf(superClassIRI="http://www.w3.org/2008/05/skos-xl#Label") org.eclipse.rdf4j.model.IRI labelCls, SKOSXL.XLabelCreationMode mode, @Optional(defaultValue="true") boolean checkExistingAltLabel, @Optional(defaultValue="true") boolean checkExistingPrefLabel) throws URIGenerationException, PrefPrefLabelClashException, PrefAltLabelClashException -
removePrefLabel
@STServiceOperation(method=POST) @Write @PreAuthorize("@auth.isAuthorized(\'rdf(\' +@auth.typeof(#concept)+ \', lexicalization)\', \'{lang: \'\'\' +@auth.langof(#xlabel)+ \'\'\'}\', \'D\')") public void removePrefLabel(@LocallyDefined @Modified org.eclipse.rdf4j.model.IRI concept, @LocallyDefined org.eclipse.rdf4j.model.Resource xlabel) -
removeAltLabel
@STServiceOperation(method=POST) @Write @PreAuthorize("@auth.isAuthorized(\'rdf(\' +@auth.typeof(#concept)+ \', lexicalization)\', \'{lang: \'\'\' +@auth.langof(#xlabel)+ \'\'\'}\', \'D\')") public void removeAltLabel(@LocallyDefined @Modified org.eclipse.rdf4j.model.IRI concept, @LocallyDefined org.eclipse.rdf4j.model.Resource xlabel) -
removeHiddenLabel
@STServiceOperation(method=POST) @Write @PreAuthorize("@auth.isAuthorized(\'rdf(\' +@auth.typeof(#concept)+ \', lexicalization)\', \'{lang: \'\'\' +@auth.langof(#xlabel)+ \'\'\'}\', \'D\')") public void removeHiddenLabel(@LocallyDefined @Modified org.eclipse.rdf4j.model.IRI concept, @LocallyDefined org.eclipse.rdf4j.model.Resource xlabel) -
changeLabelInfo
@STServiceOperation(method=POST) @Write public void changeLabelInfo(@LocallyDefined @Modified org.eclipse.rdf4j.model.Resource xlabel, @LanguageTaggedString @LanguageTaggedString org.eclipse.rdf4j.model.Literal literal) -
updateSKOSXLLexicalizationProperty
@STServiceOperation(method=POST) @Write @PreAuthorize("@auth.isAuthorized(\'rdf(\' +@auth.typeof(#subject)+ \', lexicalization)\', \'{lang: \'\'\' +@auth.langof(#value)+ \'\'\'}\', \'U\')") public void updateSKOSXLLexicalizationProperty(@LocallyDefined @Modified org.eclipse.rdf4j.model.Resource subject, @SKOSXLLabelProperty org.eclipse.rdf4j.model.IRI property, @SKOSXLLabelProperty org.eclipse.rdf4j.model.IRI newProperty, org.eclipse.rdf4j.model.Value value) -
checkIfAddPrefLabelIsPossible
public static void checkIfAddPrefLabelIsPossible(org.eclipse.rdf4j.repository.RepositoryConnection repoConnection, org.eclipse.rdf4j.model.Literal newLabel, boolean newResource, List<org.eclipse.rdf4j.model.IRI> conceptSchemes, RDFResourceRole rdfResourceRole) throws PrefPrefLabelClashException - Throws:
PrefPrefLabelClashException
-
checkIfPrefAltLabelClash
public static void checkIfPrefAltLabelClash(org.eclipse.rdf4j.repository.RepositoryConnection repoConnection, org.eclipse.rdf4j.model.Literal newLabel, RDFResourceRole rdfResourceRole) throws PrefAltLabelClashException - Throws:
PrefAltLabelClashException
-
checkIfAddAltLabelIsPossible
public static void checkIfAddAltLabelIsPossible(org.eclipse.rdf4j.repository.RepositoryConnection repoConnection, org.eclipse.rdf4j.model.Literal newLabel, org.eclipse.rdf4j.model.Resource resource) throws AltPrefLabelClashException - Throws:
AltPrefLabelClashException
-