public R2RMLWriter(Mapping mapping) {
   super(mapping);
   this.mapping = mapping;
   prefixes.setNsPrefixes(mapping.getPrefixes());
   if (!prefixes.getNsPrefixMap().containsValue(RR.NS)) {
     prefixes.setNsPrefix("rr", RR.NS);
   }
 }
Beispiel #2
0
  @Override
  public SecuredPrefixMapping withDefaultMappings(final PrefixMapping map) {
    // mapping only updates if there are map entries to add.  Since this gets called
    // when we are doing deep triple checks while writing we need to attempt the
    // update only if there are new updates to add.

    PrefixMapping m = holder.getBaseItem();
    PrefixMappingImpl pm = new PrefixMappingImpl();
    for (Entry<String, String> e : map.getNsPrefixMap().entrySet()) {
      if (m.getNsPrefixURI(e.getKey()) == null && m.getNsURIPrefix(e.getValue()) == null) {
        pm.setNsPrefix(e.getKey(), e.getValue());
      }
    }
    if (!pm.getNsPrefixMap().isEmpty()) {
      checkUpdate();
      holder.getBaseItem().withDefaultMappings(pm);
    }
    return holder.getSecuredItem();
  }