Class RDFSource

    • Field Detail

      • rdf

        protected static final RDF rdf
        The RDF Factory instance.
    • Constructor Detail

      • RDFSource

        protected RDFSource​(URI identifier,
                            Dataset dataset)
        Create a new RDF-bearing resource.

        Subclasses should have the same constructor signature to work with the provided object mapping mechanism.

        Parameters:
        identifier - the resource identifier
        dataset - the dataset corresponding to this resource, may be null
      • RDFSource

        protected RDFSource​(URI identifier,
                            RDFSyntax syntax,
                            Dataset dataset)
        Create a new RDF-bearing resource.

        Subclasses should have the same constructor signature to work with the provided object mapping mechanism.

        Parameters:
        identifier - the resource identifier
        syntax - the original RDF syntax in use
        dataset - the dataset corresponding to this resource, may be null
    • Method Detail

      • getIdentifier

        public URI getIdentifier()
        Description copied from interface: Resource
        The resource identifier.
        Specified by:
        getIdentifier in interface Resource
        Returns:
        the identifier
      • getContentType

        public String getContentType()
        Description copied from interface: Resource
        The content type of the resource.
        Specified by:
        getContentType in interface Resource
        Returns:
        the content type
      • serialize

        public void serialize​(RDFSyntax syntax,
                              OutputStream out)
                       throws IOException
        Serialize this object with a defined RDF syntax.
        Parameters:
        syntax - the RDF syntax
        out - the output stream
        Throws:
        IOException - in the case of an I/O error
      • validate

        public ValidationResult validate()
        Validate the dataset for this object.

        Subclasses may override this method to perform validation on the provided dataset. By default, this method is a no-op.

        Returns:
        the validation result