Class RDFArtifactRepository

    • Field Detail

      • METADATA_SUFFIX

        public static String METADATA_SUFFIX
    • Constructor Detail

      • RDFArtifactRepository

        public RDFArtifactRepository​(RDFStorage storage)
    • Method Detail

      • isReadOnly

        public boolean isReadOnly()
        Description copied from interface: ArtifactRepository
        Checks if the repository should be treated as read-only. If true is returned, all modification operations such as adding or removing artifacts should fail with a StorageException.
        Specified by:
        isReadOnly in interface ArtifactRepository
        Returns:
        true when the repository is read-only, false otherwise.
      • setReadOnly

        public void setReadOnly​(boolean readOnly)
      • getIriFactory

        public IRIFactory getIriFactory()
        Gets the IRI factory used for creating the IRIs when building a RDF graph.
      • setIriFactory

        public void setIriFactory​(IRIFactory iriFactory)
        Configures the IRI factory used for creating the IRIs when building a RDF graph.
        Parameters:
        iriFactory -
      • init

        public void init()
        Checks the repository status and initializes the metadata when necessary
      • isInitialized

        public boolean isInitialized()
        Checks whether the storage has been initialized - it seems to contain the appropriate metadata
        Returns:
        true when the repository is ready to use
      • initMetadata

        public boolean initMetadata()
        Initializes the repository metadata using the default OWL resource files.
        Returns:
        true when the repository was initialized sucessfully.
      • clearMetadata

        public void clearMetadata()
      • getArtifactIRIs

        public Collection<org.eclipse.rdf4j.model.IRI> getArtifactIRIs​(org.eclipse.rdf4j.model.IRI pageIri)
                                                                throws StorageException
        Gets the artifact IRIs for a source page only
        Parameters:
        pageIri - the source page IRI
        Returns:
        the list of artifact IRIs
        Throws:
        StorageException
      • getArtifact

        public Artifact getArtifact​(org.eclipse.rdf4j.model.IRI artifactIri)
        Description copied from interface: ArtifactRepository
        Obtains an artifact from the repository.
        Specified by:
        getArtifact in interface ArtifactRepository
        Parameters:
        artifactIri - the artifact IRI
        Returns:
        the artifact or null when there is no such artifact available
      • getArtifactModel

        public org.eclipse.rdf4j.model.Model getArtifactModel​(org.eclipse.rdf4j.model.IRI artifactIri)
      • createArtifactIri

        public org.eclipse.rdf4j.model.IRI createArtifactIri​(Artifact artifact)
        Description copied from interface: ArtifactRepository
        Generates a unique IRI for a new artifact based on the strategy of the given repository.
        Specified by:
        createArtifactIri in interface ArtifactRepository
        Parameters:
        artifact - the artifact to generate to IRI for
        Returns:
        The generated IRI
      • replaceArtifact

        public void replaceArtifact​(org.eclipse.rdf4j.model.IRI artifactIri,
                                    Artifact artifact)
        Description copied from interface: ArtifactRepository
        Sets an IRI to a artifact and stores it into the repository while replacing the eventual existing artifact with that IRI.
        Specified by:
        replaceArtifact in interface ArtifactRepository
        Parameters:
        artifactIri - the target IRI
        artifact - the artifact to store
      • removeArtifact

        public void removeArtifact​(org.eclipse.rdf4j.model.IRI artifactIri)
        Description copied from interface: ArtifactRepository
        Removes an artifact and all its derived artifacts from the repository.
        Specified by:
        removeArtifact in interface ArtifactRepository
        Parameters:
        artifactIri - the artifact IRI
      • getMetadataIRI

        public org.eclipse.rdf4j.model.IRI getMetadataIRI​(org.eclipse.rdf4j.model.IRI artifactIri)
      • clearContext

        public void clearContext​(org.eclipse.rdf4j.model.IRI contextIri)
      • initDefaultModelBuilders

        protected void initDefaultModelBuilders()
      • addModelBuilder

        public void addModelBuilder​(org.eclipse.rdf4j.model.IRI artifactType,
                                    ModelBuilder builder)
      • getModelBuilder

        public ModelBuilder getModelBuilder​(org.eclipse.rdf4j.model.IRI artifactType)
      • addModelLoader

        public void addModelLoader​(org.eclipse.rdf4j.model.IRI artifactType,
                                   ModelLoader builder)
      • getModelLoader

        public ModelLoader getModelLoader​(org.eclipse.rdf4j.model.IRI artifactType)