Class RDFSchemaUtils


  • public class RDFSchemaUtils
    extends Object
    This class provides a set of methods for generating RDF Schema.
    Author:
    Michele Mostarda (mostarda@fbk.eu)
    • Method Detail

      • serializeVocabulary

        public static void serializeVocabulary​(org.eclipse.rdf4j.model.IRI namespace,
                                               org.eclipse.rdf4j.model.IRI[] classes,
                                               org.eclipse.rdf4j.model.IRI[] properties,
                                               Map<org.eclipse.rdf4j.model.IRI,​String> comments,
                                               org.eclipse.rdf4j.rio.RDFWriter writer)
        Serializes a vocabulary composed of the given namespace, resources and properties.
        Parameters:
        namespace - vocabulary namespace.
        classes - list of classes.
        properties - list of properties.
        comments - map of resource comments.
        writer - writer to print out the RDF Schema triples.
        Throws:
        org.eclipse.rdf4j.rio.RDFHandlerException - if there is an error handling the RDF
      • serializeVocabulary

        public static void serializeVocabulary​(Vocabulary vocabulary,
                                               org.eclipse.rdf4j.rio.RDFWriter writer)
        Serializes the given vocabulary to triples over the given writer.
        Parameters:
        vocabulary - vocabulary to be serialized.
        writer - output writer.
        Throws:
        org.eclipse.rdf4j.rio.RDFHandlerException - if there is an error handling the RDF
      • serializeVocabulary

        public static void serializeVocabulary​(Vocabulary vocabulary,
                                               org.eclipse.rdf4j.rio.RDFFormat format,
                                               boolean willFollowAnother,
                                               PrintStream ps)
        Serializes the given vocabulary to NQuads over the given output stream.
        Parameters:
        vocabulary - vocabulary to be serialized.
        format - output format for vocabulary.
        willFollowAnother - if true another vocab will be printed in the same stream.
        ps - output stream.
        Throws:
        org.eclipse.rdf4j.rio.RDFHandlerException - if there is an error handling the RDF
      • serializeVocabulary

        public static String serializeVocabulary​(Vocabulary vocabulary,
                                                 org.eclipse.rdf4j.rio.RDFFormat format)
        Serialized the given vocabulary to NQuads and return them as string.
        Parameters:
        vocabulary - vocabulary to be serialized.
        format - output format for vocabulary.
        Returns:
        string contained serialization.
        Throws:
        org.eclipse.rdf4j.rio.RDFHandlerException - if there is an error handling the RDF
      • serializeVocabularies

        public static void serializeVocabularies​(org.eclipse.rdf4j.rio.RDFFormat format,
                                                 PrintStream ps)
        Serializes all the vocabularies to NQuads over the given output stream.
        Parameters:
        format - output format for vocabularies.
        ps - output print stream.