@Description(value="Randomic converter. Generates a URI concatenating a prefix with a 8-digits hexadecimal randomic char sequence. The converter takes two input parameters:\n\t- xRole: tells the nature of the resource. Available\n\t- args: a map of further optional arguments. They depends on the xRole parameter as follow:\n\t\t- concept (for skos:Concepts)\n\t\t\t- label: the accompanying preferred label of the skos:Concept (or literal form of the accompanying xLabel)skos:Concept\n\t\t\t- schemes: the concept schemes to which the concept is being attached at the moment of its creation (serialized as a Turtle collection)\n\t\t- conceptScheme (for skos:ConceptSchemes)\n\t\t\t- label: the accompanying preferred label of the skos:Concept (or literal form of the accompanying xLabel)\n\t\t- skosCollection (for skos:Collections)\n\t\t\t- label: the accompanying preferred label of the skos:Collection (or literal form of the accompanying xLabel)\n\t\t- xLabel (for skosxl:Labelss)\n\t\t\t- lexicalForm: the lexical form of the skosxl:Label\n\t\t\t- lexicalizedResource: the resource to which the skosxl:Label will be attached to\n\t\t\t- lexicalizationProperty: the property used for attaching the label\n\t\t- xNote (for reified skos:notes)\n\t\t\t- value: the content of the note\n\t\t\t- annotatedResource: the resource being annotated\n\t\t\t- noteProperty: the property used for annotation\n\t\t- A custom prefix that will be placed befor the randomic sequence.") public interface RandomIdGenerator extends Converter
RandomIdGenerator
contract generates resource identifiers in a
random manner, i.e. producing different outputs for the same arguments.
Its identifier is "http://art.uniroma2.it/coda/contracts/randIdGen".Modifier and Type | Interface and Description |
---|---|
static class |
RandomIdGenerator.PARAMETERS |
static class |
RandomIdGenerator.XRoles |
Modifier and Type | Field and Description |
---|---|
static String |
CONTRACT_URI |
OSGI_SERVICE_PROPERTY_CONTRACT, OSGI_SERVICE_PROPERTY_CONVERTER, STATIC_FIELD_CONTRACT_URI, STATIC_FIELD_CONVERTER_URI
Modifier and Type | Method and Description |
---|---|
org.eclipse.rdf4j.model.IRI |
produceURI(CODAContext ctx,
String value)
An overload of
produceURI(CODAContext, String, String, Map) without an explicit xRole and
parameter map. |
org.eclipse.rdf4j.model.IRI |
produceURI(CODAContext ctx,
String value,
String xRole)
An overload of
produceURI(CODAContext, String, String, Map) without an explicit parameter map. |
org.eclipse.rdf4j.model.IRI |
produceURI(CODAContext ctx,
String value,
String xRole,
Map<String,org.eclipse.rdf4j.model.Value> args)
Returns a resource identifier produced randomly from the given inputs.
|
static final String CONTRACT_URI
@FeaturePathArgument(requirementLevel=IGNORED) org.eclipse.rdf4j.model.IRI produceURI(CODAContext ctx, String value, @Parameter(name="xRole") String xRole, @Parameter(name="args") Map<String,org.eclipse.rdf4j.model.Value> args) throws ConverterException
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
.
For each specific xRole
, the client should provide some agreed-upon parameters to the
converters. This contract defines the following parameters:
concept
(for skos:Concept
s)
label
(optional): the accompanying preferred label of the skos:Concept (or
literal form of the accompanying xLabel)schemes
(optional): the concept schemes to which the concept is being
attached at the moment of its creation (serialized as a Turtle collection)conceptScheme
(for skos:ConceptScheme
s)
label
(optional): the accompanying preferred label of the skos:Concept (or
literal form of the accompanying xLabel)skosCollection
(for skos:Collection
s)
label
(optional): the accompanying preferred label of the skos:Collection (or
literal form of the accompanying xLabel)xLabel
(for skosxl:Labels
s)
lexicalForm
: the lexical form of the skosxl:LabellexicalizedResource
: the resource to which the skosxl:Label will be attached to
lexicalizationProperty
: the property used for attaching the labelxNote
skos:note
s)
value
: the content of the noteannotatedResource
: the resource being annotatednoteProperty
: the property used for annotationxRole
s are defined elsewhere by the party defining
that xRole
.
Users of this contract should always supply values for the required parameters associated with an
xRole
; therefore, they should not attempt to generate a URI for an xRole
unless they known what arguments are requested.
Conversely, it is a duty of the specific converter implementing this contract to verify that all
relevant information has been provided by the client. In fact, it is suggested that converters are
implemented defensively, that is to say they should:
xRole
s gracefully, by means some fallback strategyctx
- the conversion contextvalue
- the value seeding the generation of the identifier (ignored in this case)xRole
- an extension of the notion of role (see RDFResourceRolesEnum
), allowing for finer
grained distinctionsargs
- additional arguments, depending on the specific type of identifierConverterException
@FeaturePathArgument(requirementLevel=IGNORED) org.eclipse.rdf4j.model.IRI produceURI(CODAContext ctx, String value, @Parameter(name="xRole") String xRole) throws ConverterException
produceURI(CODAContext, String, String, Map)
without an explicit parameter map.ctx
- value
- xRole
- ConverterException
@FeaturePathArgument(requirementLevel=IGNORED) org.eclipse.rdf4j.model.IRI produceURI(CODAContext ctx, String value) throws ConverterException
produceURI(CODAContext, String, String, Map)
without an explicit xRole and
parameter map.ctx
- value
- ConverterException
Copyright © 2022 ART Group, University of Rome, Tor Vergata. All rights reserved.