use of org.apache.jena.iri.IRI in project jena by apache.
the class ParserProfileStd method makeIRI.
@Override
public IRI makeIRI(String uriStr, long line, long col) {
IRI iri = resolver.resolveSilent(uriStr);
// Some specific problems and specific error messages,.
if (uriStr.contains(" ")) {
// Specific check for spaces.
errorHandler.warning("Bad IRI: <" + uriStr + "> Spaces are not legal in URIs/IRIs.", line, col);
return iri;
}
if (!checking)
return iri;
// At this point, IRI "errors" are warnings.
// A tuned set of checking.
CheckerIRI.iriViolations(iri, errorHandler, line, col);
return iri;
}
use of org.apache.jena.iri.IRI in project jena by apache.
the class FastAbbreviatingPrefixMap method expand.
@Override
public String expand(String prefix, String localName) {
prefix = canonicalPrefix(prefix);
IRI x = prefixes.get(prefix);
if (x == null)
return null;
return x.toString() + localName;
}
use of org.apache.jena.iri.IRI in project jena by apache.
the class FastAbbreviatingPrefixMap method delete.
@Override
public void delete(String prefix) {
prefix = canonicalPrefix(prefix);
IRI iri = this.prefixes.get(prefix);
if (iri == null)
return;
// Delete the abbreviation mapping
this.abbrevs.remove(iri.toString());
// Delete the mapping
this.prefixes.remove(prefix);
}
use of org.apache.jena.iri.IRI in project jena by apache.
the class NodeFormatterTTL method abbrevByBase.
/** Abbreviate the URI */
private String abbrevByBase(String uri) {
IRI rel = iriResolver.relativize(uri, relFlags);
String r = null;
try {
r = rel.toASCIIString();
} catch (MalformedURLException ex) {
r = rel.toString();
}
return r;
}
use of org.apache.jena.iri.IRI in project jena by apache.
the class PrefixMapBase method toString.
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{ ");
boolean first = true;
for (Entry<String, IRI> e : this.getMapping().entrySet()) {
String prefix = e.getKey();
IRI iri = e.getValue();
if (first)
first = false;
else
sb.append(" ,");
sb.append(prefix);
sb.append(":=");
sb.append(iri.toString());
}
sb.append(" }");
return sb.toString();
}
Aggregations