Exemple #1
0
  /**
   * Create a parser profile for the given setup
   *
   * @param baseIRI Base IRI
   * @param resolveIRIs Whether to resolve IRIs
   * @param checking Whether to check
   * @param handler Error handler
   * @return ParserProfile
   * @see #profile for per-language setup
   */
  public static ParserProfile profile(
      String baseIRI, boolean resolveIRIs, boolean checking, ErrorHandler handler) {
    LabelToNode labelToNode =
        true ? SyntaxLabels.createLabelToNode() : LabelToNode.createUseLabelEncoded();

    Prologue prologue;
    if (resolveIRIs)
      prologue = new Prologue(PrefixMapFactory.createForInput(), IRIResolver.create(baseIRI));
    else prologue = new Prologue(PrefixMapFactory.createForInput(), IRIResolver.createNoResolve());

    if (checking) return new ParserProfileChecker(prologue, handler, labelToNode);
    else return new ParserProfileBase(prologue, handler, labelToNode);
  }
Exemple #2
0
 public static PrefixMap prefixMap(Graph graph) {
   return PrefixMapFactory.create(graph.getPrefixMapping());
 }
Exemple #3
0
 public static PrefixMap prefixMap(DatasetGraph dsg) {
   return PrefixMapFactory.create(dsg.getDefaultGraph().getPrefixMapping());
 }