Class SubjectProviderDefault
java.lang.Object
org.linkedopenactors.rdfpub.domain.commonsrdf.SubjectProviderDefault
- All Implemented Interfaces:
PrefixMapper
,SubjectProvider
@Component
public class SubjectProviderDefault
extends Object
implements SubjectProvider, PrefixMapper
-
Constructor Summary
ConstructorDescriptionSubjectProviderDefault
(org.apache.commons.rdf.api.RDF rdf, SubjectProviderSettings subjectProviderSettings) -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.commons.rdf.api.IRI
extractActor
(org.apache.commons.rdf.api.IRI subject) Extracts the actor subject from the passed IRI.org.apache.commons.rdf.api.IRI
provide4Activity
(org.apache.commons.rdf.api.IRI actorSubject) Generates a new unique IRI, starting with the actors subject.org.apache.commons.rdf.api.IRI
provide4Activity
(Actor actor) Generates a new unique IRI, starting with the actors subject.org.apache.commons.rdf.api.IRI
provide4Resource
(org.apache.commons.rdf.api.IRI actorSubject) Generates a new unique IRI, starting with the actors subject.org.apache.commons.rdf.api.IRI
provide4Resource
(Actor actor) Generates a new unique IRI, starting with the actors subject.org.apache.commons.rdf.api.IRI
org.apache.commons.rdf.api.IRI
resolveExternal
(String internalAsString) Internal rdfpub is working with urn:someId.org.apache.commons.rdf.api.IRI
resolveExternal
(org.apache.commons.rdf.api.IRI internalIriParam) resolveInternal
(String internalAsString) org.apache.commons.rdf.api.IRI
resolveInternal
(org.apache.commons.rdf.api.IRI internalAsIri)
-
Constructor Details
-
SubjectProviderDefault
public SubjectProviderDefault(org.apache.commons.rdf.api.RDF rdf, SubjectProviderSettings subjectProviderSettings)
-
-
Method Details
-
provideUniqueActorSubject
public org.apache.commons.rdf.api.IRI provideUniqueActorSubject()- Specified by:
provideUniqueActorSubject
in interfaceSubjectProvider
- Returns:
- Provides an internal urn for a new actor, that is normally not an http(s) IRI. Sample: 'rdfpub/'.
-
provideInstanceActorSubject
public org.apache.commons.rdf.api.IRI provideInstanceActorSubject()- Specified by:
provideInstanceActorSubject
in interfaceSubjectProvider
-
provide4Resource
Description copied from interface:SubjectProvider
Generates a new unique IRI, starting with the actors subject.- Specified by:
provide4Resource
in interfaceSubjectProvider
- Parameters:
actor
-- Returns:
- A new unique IRI, starting with the actors subject and a token 'res'.
-
provide4Resource
public org.apache.commons.rdf.api.IRI provide4Resource(org.apache.commons.rdf.api.IRI actorSubject) Description copied from interface:SubjectProvider
Generates a new unique IRI, starting with the actors subject. The actors subject is extracted from the passed actorSubject.- Specified by:
provide4Resource
in interfaceSubjectProvider
- Parameters:
actorSubject
-- Returns:
- A new unique IRI, starting with the actors subject and a token 'res'.
-
provide4Activity
Description copied from interface:SubjectProvider
Generates a new unique IRI, starting with the actors subject.- Specified by:
provide4Activity
in interfaceSubjectProvider
- Parameters:
actor
-- Returns:
- A new unique IRI, starting with the actors subject and a token 'acti'.
-
provide4Activity
public org.apache.commons.rdf.api.IRI provide4Activity(org.apache.commons.rdf.api.IRI actorSubject) Description copied from interface:SubjectProvider
Generates a new unique IRI, starting with the actors subject. The actors subject is extracted from the passed actorSubject.- Specified by:
provide4Activity
in interfaceSubjectProvider
- Parameters:
actorSubject
-- Returns:
- A new unique IRI, starting with the actors subject and a token 'acti'.
-
extractActor
public org.apache.commons.rdf.api.IRI extractActor(org.apache.commons.rdf.api.IRI subject) Description copied from interface:SubjectProvider
Extracts the actor subject from the passed IRI. E.g. if there are a postfix in the passed actorSubject.- Specified by:
extractActor
in interfaceSubjectProvider
- Parameters:
subject
-- Returns:
- The subject of the
-
resolveExternal
public org.apache.commons.rdf.api.IRI resolveExternal(org.apache.commons.rdf.api.IRI internalIriParam) - Specified by:
resolveExternal
in interfaceSubjectProvider
- Parameters:
internalIriParam
- The internal url, that has to be resolve to a instance URL.- Returns:
- The instanze URL, https://xyz...
-
getInternaleIriPrefix
- Specified by:
getInternaleIriPrefix
in interfacePrefixMapper
- Specified by:
getInternaleIriPrefix
in interfaceSubjectProvider
- Returns:
- Something like urn:somePath
-
getExternalIriPrefix
- Specified by:
getExternalIriPrefix
in interfacePrefixMapper
- Specified by:
getExternalIriPrefix
in interfaceSubjectProvider
- Returns:
- something like https://myRdfpubInstance.org/somePath
-
resolveExternal
Description copied from interface:SubjectProvider
Internal rdfpub is working with urn:someId. asExternal translates this internal IRI in an external one. E.g. https://myRdfpubInstance.org/someId.- Specified by:
resolveExternal
in interfaceSubjectProvider
- Parameters:
internalAsString
- the iri to translate from intern to extern.- Returns:
- The external representation of the passed iri.
-
resolveInternal
public org.apache.commons.rdf.api.IRI resolveInternal(org.apache.commons.rdf.api.IRI internalAsIri) - Specified by:
resolveInternal
in interfaceSubjectProvider
- Parameters:
internalAsIri
-- Returns:
- The internal representation of the passed iri.
-
resolveInternal
- Specified by:
resolveInternal
in interfaceSubjectProvider
-