Class RiotLib

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

public class RiotLib extends Object
Misc RIOT code
  • 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 Node blankNodeToIri(Node node)
      "Skolemize" to a node. Returns a Node_URI.
    • blankNodeToIriString

      public static String blankNodeToIriString(Node node)
      "Skolemize" to a string.
    • createIRIorBNode

      public static 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 a ARQ-encoded blank node.
    • isPrefixIRI

      public static boolean isPrefixIRI(String iri)
      Test whether a IRI is a 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 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 default settings, and a specific error handler.
    • createParserProfile

      public static ParserProfile createParserProfile(FactoryRDF factory, ErrorHandler errorHandler, IRIxResolver resolver, boolean checking)
      Create a ParserProfile.
    • triplesOfSubject

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

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

      public static long countTriples(Graph graph, Node s, Node p, Node o)
    • countTriples

      public static long countTriples(DatasetGraph dsg, Node s, Node p, Node o)
    • accTriples

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

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

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

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

      public static void writePrefixOldStyle(org.apache.jena.atlas.io.IndentedWriter out, String prefix, String uri, int intent)
      Write prefixes, using @prefix
    • prefixMap

      @Deprecated public static PrefixMap prefixMap(DatasetGraph dsg)
      Deprecated.
    • 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)
    • prefixMap

      @Deprecated public static PrefixMap prefixMap(Graph graph)
    • adapter

      public static WriterGraphRIOTBase adapter(WriterDatasetRIOT writer)