Пример #1
0
    private void outputTripleOfQuad(Quad quad) {
      String s = FmtUtils.stringForNode(quad.getSubject(), sCxt);
      String p = FmtUtils.stringForNode(quad.getPredicate(), sCxt);
      String o = FmtUtils.stringForNode(quad.getObject(), sCxt);

      out.print(s);
      out.print(" ");
      out.print(p);
      out.print(" ");
      out.print(o);
    }
Пример #2
0
  public static String lang(Node node) {
    if (!node.isLiteral())
      NodeValue.raise(
          new ExprTypeException("lang: Not a literal: " + FmtUtils.stringForNode(node)));

    String s = node.getLiteralLanguage();
    if (s == null) s = "";
    return s;
  }
Пример #3
0
    public void visit(UpdateCreate update) {
      out.ensureStartOfLine();
      out.print("CREATE");
      out.print(" ");
      if (update.isSilent()) out.print("SILENT ");

      String s = FmtUtils.stringForNode(update.getGraph(), sCxt);
      out.print(s);
    }
Пример #4
0
 public static void output(IndentedWriter out, List<Node> nodeList, SerializationContext naming) {
   out.print("(");
   boolean first = true;
   for (Node node : nodeList) {
     if (!first) out.print(" ");
     out.print(FmtUtils.stringForNode(node, naming));
     first = false;
   }
   out.print(")");
 }
Пример #5
0
 @Override
 public String asSparqlTerm(PrefixLogger pl) {
   String lang = (language.equals("none") ? "" : language);
   RDFDatatype dt =
       datatype.length() == 0 ? null : TypeMapper.getInstance().getSafeTypeByName(datatype);
   Node n = NodeFactory.createLiteral(spelling, lang, dt);
   if (datatype.length() > 0) pl.present(datatype);
   String lf = FmtUtils.stringForNode(n, RDFUtils.noPrefixes);
   return lf;
 }
Пример #6
0
    private void outputQuad(Quad quad) {
      String qs = FmtUtils.stringForQuad(quad, sCxt.getPrefixMapping());

      if (quad.getGraph() != null) {
        String g = FmtUtils.stringForNode(quad.getGraph(), sCxt);
        out.print(g);
        out.print(" ");
      }
      outputTripleOfQuad(quad);
      out.println(" .");
    }
Пример #7
0
 private void printTargetUpdate2(Target target) {
   if (target.isDefault()) {
     out.print("DEFAULT");
   } else if (target.isOneNamedGraph()) {
     // out.print("GRAPH ") ;
     String s = FmtUtils.stringForNode(target.getGraph(), sCxt);
     out.print(s);
   } else {
     out.print("Target BROKEN / Update2");
     throw new ARQException("Malformed Target / Update2");
   }
 }
Пример #8
0
 private void printTarget(Target target) {
   if (target.isAll()) {
     out.print("ALL");
   } else if (target.isAllNamed()) {
     out.print("NAMED");
   } else if (target.isDefault()) {
     out.print("DEFAULT");
   } else if (target.isOneNamedGraph()) {
     out.print("GRAPH ");
     String s = FmtUtils.stringForNode(target.getGraph(), sCxt);
     out.print(s);
   } else {
     out.print("Target BROKEN");
     throw new ARQException("Malformed Target");
   }
 }
Пример #9
0
 private void output(Node node) {
   String $ = FmtUtils.stringForNode(node, sCxt);
   out.print($);
 }
Пример #10
0
 public static void output(IndentedWriter out, Node node, SerializationContext naming) {
   out.print(FmtUtils.stringForNode(node, naming));
 }
Пример #11
0
 public static String displayStr(Node n) {
   return FmtUtils.stringForNode(n);
 }