Class QuadsToJsonld

    • Field Detail

      • ordered

        protected boolean ordered
      • useNativeTypes

        protected boolean useNativeTypes
      • useRdfType

        protected boolean useRdfType
      • compoundLiteralSubjects

        protected java.util.Map<java.lang.String,​java.util.Map<java.lang.String,​java.lang.Boolean>> compoundLiteralSubjects
      • referenceOnce

        protected java.util.Map<java.lang.String,​GraphMap.Reference> referenceOnce
    • Constructor Detail

      • QuadsToJsonld

        public QuadsToJsonld()
    • Method Detail

      • ordered

        public QuadsToJsonld ordered​(boolean ordered)
        Configures whether the output should be ordered.
        Parameters:
        ordered - true if ordering is required; false otherwise
        Returns:
        this instance for chaining
      • rdfDirection

        public QuadsToJsonld rdfDirection​(JsonLdOptions.RdfDirection rdfDirection)
        Sets the RDF direction configuration.
        Parameters:
        rdfDirection - the RDF direction (e.g., COMPOUND_LITERAL)
        Returns:
        this instance for chaining
      • useNativeTypes

        public QuadsToJsonld useNativeTypes​(boolean useNativeTypes)
        Configures whether to use native types for literal conversion.
        Parameters:
        useNativeTypes - true to use native types; false otherwise
        Returns:
        this instance for chaining
      • useRdfType

        public QuadsToJsonld useRdfType​(boolean useRdfType)
      • mode

        public QuadsToJsonld mode​(JsonLdVersion processingMode)
        Sets the JSON-LD processing mode.
        Parameters:
        processingMode - the processing mode (e.g., V1_0, V1_1)
        Returns:
        this instance for chaining
      • uriValidation

        public QuadsToJsonld uriValidation​(UriValidationPolicy uriValidation)
        Sets the URI validation policy.
        Parameters:
        uriValidation - the URI validation policy
        Returns:
        this instance for chaining
      • reset

        public QuadsToJsonld reset()
        Resets the consumer to an empty state, allowing the same instance to process different datasets.
        Returns:
        the current QuadsToJsonld instance after resetting
      • toJsonLd

        public jakarta.json.JsonArray toJsonLd()
                                        throws JsonLdError
        Generates a new JSON-LD representation based on the received quads.

        This method processes all the quads stored in the internal graph map and transforms them into a JSON-LD document in expanded form.

        Returns:
        a JsonArray containing the generated JSON-LD data
        Throws:
        JsonLdError - if an error occurs during JSON-LD generation
      • quad

        public com.apicatalog.rdf.api.RdfQuadConsumer quad​(java.lang.String subject,
                                                           java.lang.String predicate,
                                                           java.lang.String object,
                                                           java.lang.String datatype,
                                                           java.lang.String language,
                                                           java.lang.String direction,
                                                           java.lang.String graph)
                                                    throws com.apicatalog.rdf.api.RdfConsumerException
        Specified by:
        quad in interface com.apicatalog.rdf.api.RdfQuadConsumer
        Throws:
        com.apicatalog.rdf.api.RdfConsumerException
      • toObject

        jakarta.json.JsonObject toObject​(java.lang.String object,
                                         java.lang.String datatype,
                                         java.lang.String langTag,
                                         java.lang.String direction)
                                  throws com.apicatalog.rdf.api.RdfConsumerException
        Throws:
        com.apicatalog.rdf.api.RdfConsumerException