Class W3CRDFSyntax

    • Field Detail

      • syntaxes

        static final java.util.Set<RDFSyntax> syntaxes
      • title

        private final java.lang.String title
      • mediaType

        private final java.lang.String mediaType
      • fileExtension

        private final java.lang.String fileExtension
      • supportsDataset

        private final boolean supportsDataset
      • name

        private final java.lang.String name
      • iri

        private final IRI iri
    • Constructor Detail

      • W3CRDFSyntax

        private W3CRDFSyntax​(java.lang.String name,
                             java.lang.String title,
                             java.lang.String mediaType,
                             java.lang.String fileExtension,
                             boolean supportsDataset)
    • Method Detail

      • mediaType

        public java.lang.String mediaType()
        The IANA media type for the RDF syntax.

        The media type can be used as part of Content-Type and Accept for content negotiation in the HTTP protocol.

        W3CRDFSyntax always defines media type in lower case, so String.toLowerCase(Locale) need not be called.

        Specified by:
        mediaType in interface RDFSyntax
        Returns:
        The registered media type of the RDF Syntax
      • fileExtension

        public java.lang.String fileExtension()
        The IANA-registered file extension.

        The file extension includes the leading period, e.g. .jsonld

        W3CRDFSyntax always defines file extensions in lower case, so String.toLowerCase(Locale) need not be called.

        Specified by:
        fileExtension in interface RDFSyntax
        Returns:
        The registered file extension of the RDF Syntax
      • supportsDataset

        public boolean supportsDataset()
        Description copied from interface: RDFSyntax
        Indicate if this RDF syntax supports RDF Datasets.
        Specified by:
        supportsDataset in interface RDFSyntax
        Returns:
        true if this RDF Syntax supports datasets; false otherwise
      • title

        public java.lang.String title()
        Description copied from interface: RDFSyntax
        The title of the RDF Syntax.

        This is generally the title of the corresponding standard, e.g. RDF 1.1 Turtle.

        Specified by:
        title in interface RDFSyntax
        Returns:
        Title of RDF Syntax
      • name

        public java.lang.String name()
        Description copied from interface: RDFSyntax
        A short name of the RDF Syntax e.g. JSONLD.

        The name is specific to Commons RDF and carries no particular meaning.

        Specified by:
        name in interface RDFSyntax
        Returns:
        Short name for RDF syntax
      • iri

        public IRI iri()
        Description copied from interface: RDFSyntax
        Return the IRI that identifies the RDF syntax.

        Note that the identifying IRI is generally distinct from the IRI of the document that specifies the RDF syntax.

        Specified by:
        iri in interface RDFSyntax
        Returns:
        Identifying IRI, e.g. http://www.w3.org/ns/formats/JSON-LD
      • equals

        public boolean equals​(java.lang.Object obj)
        Description copied from interface: RDFSyntax
        Compare this RDFSyntax with another object.

        Two RDFSyntaxes are considered equal if their RDFSyntax.mediaType()s are equal when compared as lower case strings according to String.toLowerCase(Locale) with the locale Locale.ROOT.

        Specified by:
        equals in interface RDFSyntax
        Overrides:
        equals in class java.lang.Object
        Parameters:
        obj - the object with which to compare
        Returns:
        true if this object is the same as the obj argument; false otherwise
      • hashCode

        public int hashCode()
        Description copied from interface: RDFSyntax
        The hash code of an RDFSyntax is equivalent to the hash code of the RDFSyntax.mediaType() in lower case according to String.toLowerCase(Locale) with the locale Locale.ROOT.
        Specified by:
        hashCode in interface RDFSyntax
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        Hash code of RDFSyntax
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object