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 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 interface SubjectProvider
      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 interface SubjectProvider
    • provide4Resource

      public org.apache.commons.rdf.api.IRI provide4Resource(Actor actor)
      Description copied from interface: SubjectProvider
      Generates a new unique IRI, starting with the actors subject.
      Specified by:
      provide4Resource in interface SubjectProvider
      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 interface SubjectProvider
      Parameters:
      actorSubject -
      Returns:
      A new unique IRI, starting with the actors subject and a token 'res'.
    • provide4Activity

      public org.apache.commons.rdf.api.IRI provide4Activity(Actor actor)
      Description copied from interface: SubjectProvider
      Generates a new unique IRI, starting with the actors subject.
      Specified by:
      provide4Activity in interface SubjectProvider
      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 interface SubjectProvider
      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 interface SubjectProvider
      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 interface SubjectProvider
      Parameters:
      internalIriParam - The internal url, that has to be resolve to a instance URL.
      Returns:
      The instanze URL, https://xyz...
    • getInternaleIriPrefix

      public String getInternaleIriPrefix()
      Specified by:
      getInternaleIriPrefix in interface PrefixMapper
      Specified by:
      getInternaleIriPrefix in interface SubjectProvider
      Returns:
      Something like urn:somePath
    • getExternalIriPrefix

      public String getExternalIriPrefix()
      Specified by:
      getExternalIriPrefix in interface PrefixMapper
      Specified by:
      getExternalIriPrefix in interface SubjectProvider
      Returns:
      something like https://myRdfpubInstance.org/somePath
    • resolveExternal

      public String resolveExternal(String internalAsString)
      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 interface SubjectProvider
      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 interface SubjectProvider
      Parameters:
      internalAsIri -
      Returns:
      The internal representation of the passed iri.
    • resolveInternal

      public String resolveInternal(String internalAsString)
      Specified by:
      resolveInternal in interface SubjectProvider