Esempio n. 1
0
  public static int calcWidth(PrefixMap prefixMap, String baseURI, Node p) {
    if (!prefixMap.contains(rdfNS) && RDF_type.equals(p)) return 1;

    String x = prefixMap.abbreviate(p.getURI());
    if (x == null) return p.getURI().length() + 2;
    return x.length();
  }
Esempio n. 2
0
 public static void writePrefixes(IndentedWriter out, PrefixMap prefixMap) {
   if (prefixMap != null && !prefixMap.isEmpty()) {
     for (Map.Entry<String, String> e : prefixMap.getMappingCopyStr().entrySet()) {
       out.print("@prefix ");
       out.print(e.getKey());
       out.print(": ");
       out.pad(PREFIX_IRI);
       out.print("<");
       out.print(e.getValue());
       out.print(">");
       out.print(" .");
       out.println();
     }
   }
 }
Esempio n. 3
0
 static {
   PrefixMap pmap = profile.getPrologue().getPrefixMap();
   pmap.add("rdf", ARQConstants.rdfPrefix);
   pmap.add("rdfs", ARQConstants.rdfsPrefix);
   pmap.add("xsd", ARQConstants.xsdPrefix);
   pmap.add("owl", ARQConstants.owlPrefix);
   pmap.add("fn", ARQConstants.fnPrefix);
   pmap.add("op", ARQConstants.fnPrefix);
   pmap.add("ex", "http://example/ns#");
   pmap.add("", "http://example/");
 }