Class RiotLib

java.lang.Object
org.apache.jena.riot.system.RiotLib

public class RiotLib extends Object
Misc RIOT code
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Function<String,String>
    Function applied to undefined prefixes to convert to a URI string
    static final Predicate<String>
    Function to test for undefined prefix URIs
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    accTriples(Collection<org.apache.jena.graph.Triple> acc, org.apache.jena.graph.Graph graph, org.apache.jena.graph.Node s, org.apache.jena.graph.Node p, org.apache.jena.graph.Node o)
    Collect all the matching triples
     
    static org.apache.jena.graph.Node
    blankNodeToIri(org.apache.jena.graph.Node node)
    "Skolemize" to a node.
    static String
    blankNodeToIriString(org.apache.jena.graph.Node node)
    "Skolemize" to a string.
    static long
    countTriples(org.apache.jena.graph.Graph graph, org.apache.jena.graph.Node s, org.apache.jena.graph.Node p, org.apache.jena.graph.Node o)
     
    static long
    countTriples(DatasetGraph dsg, org.apache.jena.graph.Node s, org.apache.jena.graph.Node p, org.apache.jena.graph.Node o)
     
    static org.apache.jena.atlas.io.IndentedWriter
    create(Writer writer)
    IndentedWriter over a java.io.Writer (better to use an IndentedWriter over an OutputStream)
    static org.apache.jena.graph.Node
    Implement <_:....> as a "Node IRI" that is, use the given label as the BNode internal label.
    createParserProfile(FactoryRDF factory, ErrorHandler errorHandler, boolean checking)
    Create a ParserProfile with a specific error handler, and otherwise default settings.
    createParserProfile(FactoryRDF factory, ErrorHandler errorHandler, org.apache.jena.irix.IRIxResolver resolver, boolean checking)
    Create a ParserProfile with a specific error handler, and a specific IRI resolver and otherwise default settings.
    Create a ParserProfile with default settings.
    static FactoryRDF
    Create a new (not influenced by anything else) FactoryRDF using the default label to blank node scheme.
    static FactoryRDF
    factoryRDF(LabelToNode labelMapping)
    Create a new (not influenced by anything else) FactoryRDF using the label to blank node scheme provided.
    static String
    fixupPrefixIRI(String prefixedName)
    Convert an prefix name (qname) to an IRI, for when the prefix is not defined.
    static String
    fixupPrefixIRI(String prefix, String localPart)
    Convert an prefix name (qname) to an IRI, for when the prefix is not defined.
    static org.apache.jena.graph.Node
    fromIRIorBNode(org.apache.jena.graph.Node node)
    Convert an ARQ-encoded blank node URI to a blank node, otherwise return the argument node unchanged.
    static boolean
    Test whether a IRI is an ARQ-encoded blank node.
    static boolean
    isBNodeIRI(org.apache.jena.graph.Node node)
    Test whether a node is an ARQ-encoded blank node IRI.
    static boolean
    Test whether a IRI is an ARQ-encoded blank node.
    static org.apache.jena.graph.Node
    parse(String string)
    Parse a string to get one Node (the first token in the string)
    profile(Lang lang, String baseIRI, ErrorHandler handler)
     
    static List<org.apache.jena.graph.Triple>
    triples(org.apache.jena.graph.Graph graph, org.apache.jena.graph.Node s, org.apache.jena.graph.Node p, org.apache.jena.graph.Node o)
    Get all the triples for the graph.find
    static Collection<org.apache.jena.graph.Triple>
    triplesOfSubject(org.apache.jena.graph.Graph graph, org.apache.jena.graph.Node subj)
    Get triples with the same subject
    static void
    writeBase(org.apache.jena.atlas.io.IndentedWriter out, String base)
     
    static void
    writeBase(org.apache.jena.atlas.io.IndentedWriter out, String base, DirectiveStyle writeStyle)
     
    static void
    writePrefix(org.apache.jena.atlas.io.IndentedWriter out, String prefix, String uri, DirectiveStyle writeStyle)
    Write a prefix.
    static void
    writePrefixes(org.apache.jena.atlas.io.IndentedWriter out, PrefixMap prefixMap)
     
    static void
    writePrefixes(org.apache.jena.atlas.io.IndentedWriter out, PrefixMap prefixMap, DirectiveStyle writeStyle)
    Write prefixes
    static void
    writeVersion(org.apache.jena.atlas.io.IndentedWriter out, String version, DirectiveStyle writeStyle)
    Write a version.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • fixupPrefixes

      public static final Function<String,String> fixupPrefixes
      Function applied to undefined prefixes to convert to a URI string
    • testFixupedPrefixURI

      public static final Predicate<String> testFixupedPrefixURI
      Function to test for undefined prefix URIs
  • Constructor Details

    • RiotLib

      public RiotLib()
  • Method Details

    • blankNodeToIri

      public static org.apache.jena.graph.Node blankNodeToIri(org.apache.jena.graph.Node node)
      "Skolemize" to a node. Returns a Node_URI.
    • blankNodeToIriString

      public static String blankNodeToIriString(org.apache.jena.graph.Node node)
      "Skolemize" to a string.
    • fromIRIorBNode

      public static org.apache.jena.graph.Node fromIRIorBNode(org.apache.jena.graph.Node node)
      Convert an ARQ-encoded blank node URI to a blank node, otherwise return the argument node unchanged.
    • createIRIorBNode

      public static org.apache.jena.graph.Node createIRIorBNode(String str)
      Implement <_:....> as a "Node IRI" that is, use the given label as the BNode internal label. Use with care. Returns a Node_URI.
    • isBNodeIRI

      public static boolean isBNodeIRI(String iri)
      Test whether a IRI is an ARQ-encoded blank node.
    • isBNodeIRI

      public static boolean isBNodeIRI(org.apache.jena.graph.Node node)
      Test whether a node is an ARQ-encoded blank node IRI.
    • isPrefixIRI

      public static boolean isPrefixIRI(String iri)
      Test whether a IRI is an ARQ-encoded blank node.
    • fixupPrefixIRI

      public static String fixupPrefixIRI(String prefix, String localPart)
      Convert an prefix name (qname) to an IRI, for when the prefix is not defined.
      See Also:
    • fixupPrefixIRI

      public static String fixupPrefixIRI(String prefixedName)
      Convert an prefix name (qname) to an IRI, for when the prefix is not defined.
      See Also:
    • parse

      public static org.apache.jena.graph.Node parse(String string)
      Parse a string to get one Node (the first token in the string)
    • profile

      public static ParserProfile profile(Lang lang, String baseIRI, ErrorHandler handler)
    • factoryRDF

      public static FactoryRDF factoryRDF(LabelToNode labelMapping)
      Create a new (not influenced by anything else) FactoryRDF using the label to blank node scheme provided.
    • factoryRDF

      public static FactoryRDF factoryRDF()
      Create a new (not influenced by anything else) FactoryRDF using the default label to blank node scheme.
    • dftProfile

      public static ParserProfile dftProfile()
      Create a ParserProfile with default settings.
    • createParserProfile

      public static ParserProfile createParserProfile(FactoryRDF factory, ErrorHandler errorHandler, boolean checking)
      Create a ParserProfile with a specific error handler, and otherwise default settings.
    • createParserProfile

      public static ParserProfile createParserProfile(FactoryRDF factory, ErrorHandler errorHandler, org.apache.jena.irix.IRIxResolver resolver, boolean checking)
      Create a ParserProfile with a specific error handler, and a specific IRI resolver and otherwise default settings.
    • triplesOfSubject

      public static Collection<org.apache.jena.graph.Triple> triplesOfSubject(org.apache.jena.graph.Graph graph, org.apache.jena.graph.Node subj)
      Get triples with the same subject
    • triples

      public static List<org.apache.jena.graph.Triple> triples(org.apache.jena.graph.Graph graph, org.apache.jena.graph.Node s, org.apache.jena.graph.Node p, org.apache.jena.graph.Node o)
      Get all the triples for the graph.find
    • countTriples

      public static long countTriples(org.apache.jena.graph.Graph graph, org.apache.jena.graph.Node s, org.apache.jena.graph.Node p, org.apache.jena.graph.Node o)
    • countTriples

      public static long countTriples(DatasetGraph dsg, org.apache.jena.graph.Node s, org.apache.jena.graph.Node p, org.apache.jena.graph.Node o)
    • accTriples

      public static void accTriples(Collection<org.apache.jena.graph.Triple> acc, org.apache.jena.graph.Graph graph, org.apache.jena.graph.Node s, org.apache.jena.graph.Node p, org.apache.jena.graph.Node o)
      Collect all the matching triples
    • writeBase

      public static void writeBase(org.apache.jena.atlas.io.IndentedWriter out, String base)
    • writeBase

      public static void writeBase(org.apache.jena.atlas.io.IndentedWriter out, String base, DirectiveStyle writeStyle)
    • writePrefixes

      public static void writePrefixes(org.apache.jena.atlas.io.IndentedWriter out, PrefixMap prefixMap)
    • writePrefixes

      public static void writePrefixes(org.apache.jena.atlas.io.IndentedWriter out, PrefixMap prefixMap, DirectiveStyle writeStyle)
      Write prefixes
    • writePrefix

      public static void writePrefix(org.apache.jena.atlas.io.IndentedWriter out, String prefix, String uri, DirectiveStyle writeStyle)
      Write a prefix. Write using @prefix or PREFIX.
    • writeVersion

      public static void writeVersion(org.apache.jena.atlas.io.IndentedWriter out, String version, DirectiveStyle writeStyle)
      Write a version. Write using version or VERSION.
    • create

      public static org.apache.jena.atlas.io.IndentedWriter create(Writer writer)
      IndentedWriter over a java.io.Writer (better to use an IndentedWriter over an OutputStream)
    • adapter

      public static WriterGraphRIOTBase adapter(WriterDatasetRIOT writer)