/** * Parses the supplied URI-string and sets it as the base URI for resolving relative URIs. */ protected void setBaseURI(String uriSpec) { // Store base URI if (this.baseURI == null || !this.baseURI.toString().equals(uriSpec)) { this.baseURI = ParsedIRI.create(uriSpec); } }
/** * Parses the supplied URI-string and sets it as the base URI for resolving * relative URIs. */ protected void setBaseURI(String uriSpec) { // Store base URI if (this.baseURI == null || !this.baseURI.toString().equals(uriSpec)) { this.baseURI = ParsedIRI.create(uriSpec); } }
public SPARQLOperation(HttpClient client, String url, String base, String operation) { this.url = url; this.operation = operation; this.client = client; boolean abs = base != null && base.length() > 0 && ParsedIRI.create(base).isAbsolute(); if (abs && !operation.toUpperCase().contains("BASE")) { this.operation = "BASE <" + base + "> " + operation; } }
/** * Parses the supplied URI-string and sets it as the base URI for resolving * relative URIs. */ protected void setBaseURI(String uriSpec) { // Store base URI if (this.baseURI == null || !this.baseURI.toString().equals(uriSpec)) { this.baseURI = ParsedIRI.create(uriSpec); } }
public SPARQLOperation(HttpClient client, String url, String base, String operation) { this.url = url; this.operation = operation; this.client = client; boolean abs = base != null && base.length() > 0 && ParsedIRI.create(base).isAbsolute(); if (abs && !operation.toUpperCase().contains("BASE")) { this.operation = "BASE <" + base + "> " + operation; } }
public SPARQLOperation(HttpClient client, String url, String base, String operation) { this.url = url; this.operation = operation; this.client = client; boolean abs = base != null && base.length() > 0 && ParsedIRI.create(base).isAbsolute(); if (abs && !operation.toUpperCase().contains("BASE")) { this.operation = "BASE <" + base + "> " + operation; } }
private ParsedIRI createBaseURI(String uriString) { return ParsedIRI.create(uriString).normalize(); }
public RelativeIRIResolver(ParsedURI parsedBaseURI) { this(ParsedIRI.create(parsedBaseURI.toString())); }
private ParsedIRI createBaseURI(String uriString) { return ParsedIRI.create(uriString).normalize(); }
private ParsedIRI createBaseURI(String uriString) { return ParsedIRI.create(uriString).normalize(); }
public RelativeIRIResolver(ParsedURI parsedBaseURI) { this(ParsedIRI.create(parsedBaseURI.toString())); }
public RelativeIRIResolver(ParsedURI parsedBaseURI) { this(ParsedIRI.create(parsedBaseURI.toString())); }
private Object encodeAsIri(Object value) { String iriValue; if (value instanceof Value) { iriValue = ((Value) value).stringValue(); } else { iriValue = value.toString(); } // perform unicode normalization iriValue = Normalizer.normalize(iriValue, mapper.getNormalizationForm()); return ParsedIRI.create(iriValue).toString(); }
/** * Resolves the given IRI against this ParsedIRI. * * @see #resolve(ParsedIRI) * @param iri * The IRI to be resolved against this ParsedIRI * @return The resulting IRI * @throws NullPointerException * If {@code relative} is {@code null} */ public String resolve(String iri) { return resolve(ParsedIRI.create(iri)).toString(); }
/** * Relativizes the given IRI against this ParsedIRI. * * @see #relativize(ParsedIRI) * @param iri * The IRI to be relativized against this ParsedIRI * @return The resulting IRI * @throws NullPointerException * If {@code absolute} is {@code null} */ public String relativize(String iri) { return relativize(ParsedIRI.create(iri)).toString(); }
/** * Relativizes the given IRI against this ParsedIRI. * * @see #relativize(ParsedIRI) * @param iri * The IRI to be relativized against this ParsedIRI * @return The resulting IRI * @throws NullPointerException * If {@code absolute} is {@code null} */ public String relativize(String iri) { return relativize(ParsedIRI.create(iri)).toString(); }
/** * Resolves the given IRI against this ParsedIRI. * * @see #resolve(ParsedIRI) * @param iri * The IRI to be resolved against this ParsedIRI * @return The resulting IRI * @throws NullPointerException * If {@code relative} is {@code null} */ public String resolve(String iri) { return resolve(ParsedIRI.create(iri)).toString(); }
/** * Relativizes the given IRI against this ParsedIRI. * * @see #relativize(ParsedIRI) * @param iri * The IRI to be relativized against this ParsedIRI * @return The resulting IRI * @throws NullPointerException * If {@code absolute} is {@code null} */ public String relativize(String iri) { return relativize(ParsedIRI.create(iri)).toString(); }
/** * Resolves the given IRI against this ParsedIRI. * * @see #resolve(ParsedIRI) * @param iri * The IRI to be resolved against this ParsedIRI * @return The resulting IRI * @throws NullPointerException * If {@code relative} is {@code null} */ public String resolve(String iri) { return resolve(ParsedIRI.create(iri)).toString(); }
/** * Creates a new {@link BNode} or Skolem {@link IRI} object. */ protected Resource createNode() throws RDFParseException { try { String origin = parserConfig.get(BasicParserSettings.SKOLEMIZE_ORIGIN); if (preserveBNodeIDs() || origin == null || origin.length() == 0) { return valueFactory.createBNode(); } else { String nodeId = valueFactory.createBNode().getID(); String path = "/.well-known/genid/" + nextBNodePrefix + nodeId; String iri = ParsedIRI.create(origin).resolve(path); return valueFactory.createIRI(iri); } } catch (Exception e) { reportFatalError(e); return null; // required by compiler } }