@Override public String getNamespace() { return impl.getNamespace(); }
private boolean isQName(IRI nextUri) { return namespaceTable.containsKey(nextUri.getNamespace()); }
private boolean isQName(IRI nextUri) { return namespaceTable.containsKey(nextUri.getNamespace()); }
private boolean isQName(IRI nextUri) { return namespaceTable.containsKey(nextUri.getNamespace()); }
private void writeQName(IRI uri) throws IOException { // Check if the URI has a new namespace String namespace = uri.getNamespace(); Integer nsID = namespaceTable.get(namespace); if (nsID == null) { // Generate a ID for this new namespace nsID = writeNamespace(namespace); } out.writeByte(QNAME_RECORD_MARKER); out.writeInt(nsID.intValue()); writeString(uri.getLocalName()); }
private void writeQName(IRI uri) throws IOException { // Check if the URI has a new namespace String namespace = uri.getNamespace(); Integer nsID = namespaceTable.get(namespace); if (nsID == null) { // Generate a ID for this new namespace nsID = writeNamespace(namespace); } out.writeByte(QNAME_RECORD_MARKER); out.writeInt(nsID.intValue()); writeString(uri.getLocalName()); }
private void writeQName(IRI uri) throws IOException { // Check if the URI has a new namespace String namespace = uri.getNamespace(); Integer nsID = namespaceTable.get(namespace); if (nsID == null) { // Generate a ID for this new namespace nsID = writeNamespace(namespace); } out.writeByte(QNAME_RECORD_MARKER); out.writeInt(nsID.intValue()); writeString(uri.getLocalName()); }
private static TimeUnit getTimeUnit(ValueConstant val) { Preconditions.checkArgument(val.getValue() instanceof IRI); IRI uri = (IRI) val.getValue(); Preconditions.checkArgument(uri.getNamespace().equals(temporalNameSpace)); switch (uri.getLocalName()) { case "days": return TimeUnit.DAYS; case "hours": return TimeUnit.HOURS; case "minutes": return TimeUnit.MINUTES; default: throw new IllegalArgumentException("Invalid time unit for Periodic Function."); } }
private void getUsedNamespaces(Set<Statement> stmts, Set<String> used) { for (Statement st : stmts) { used.add(st.getPredicate().getNamespace()); if (st.getObject() instanceof IRI) { IRI uri = (IRI)st.getObject(); used.add(uri.getNamespace()); } else if (st.getObject() instanceof Literal) { Literal lit = (Literal)st.getObject(); if (lit.getDatatype() != null) { used.add(lit.getDatatype().getNamespace()); } } } }
private void getUsedNamespaces(Set<Statement> stmts, Set<String> used) { for (Statement st : stmts) { used.add(st.getPredicate().getNamespace()); if (st.getObject() instanceof IRI) { IRI uri = (IRI)st.getObject(); used.add(uri.getNamespace()); } else if (st.getObject() instanceof Literal) { Literal lit = (Literal)st.getObject(); if (lit.getDatatype() != null) { used.add(lit.getDatatype().getNamespace()); } } } }
private String shorten(IRI iri) { if (shortenUris) { String localName = iri.getLocalName(); String prefix = getPrefix(iri.getNamespace()); return prefix + PREFIX_SEPARATOR + localName; } else { return iri.stringValue(); } }
private String shorten(IRI iri) { if (shortenUris) { String localName = iri.getLocalName(); String prefix = getPrefix(iri.getNamespace()); return prefix + PREFIX_SEPARATOR + localName; } else { return iri.stringValue(); } }
/** * Write a QName for the given URI if and only if the {@link BasicQueryWriterSettings#ADD_SESAME_QNAME} * setting has been set to true. By default it is false, to ensure that this implementation stays within * the specification by default. * * @param nextUri * The prefixed URI to be written as a sesame qname attribute. */ private void writeQName(IRI nextUri) { if (getWriterConfig().get(BasicQueryWriterSettings.ADD_SESAME_QNAME)) { xmlWriter.setAttribute(QNAME, namespaceTable.get(nextUri.getNamespace()) + ":" + nextUri.getLocalName()); } }
/** * Write a QName for the given URI if and only if the {@link BasicQueryWriterSettings#ADD_SESAME_QNAME} * setting has been set to true. By default it is false, to ensure that this implementation stays within * the specification by default. * * @param nextUri * The prefixed URI to be written as a sesame qname attribute. */ private void writeQName(IRI nextUri) { if (getWriterConfig().get(BasicQueryWriterSettings.ADD_SESAME_QNAME)) { xmlWriter.setAttribute(QNAME, namespaceTable.get(nextUri.getNamespace()) + ":" + nextUri.getLocalName()); } }
/** * Write a QName for the given URI if and only if the {@link BasicQueryWriterSettings#ADD_SESAME_QNAME} * setting has been set to true. By default it is false, to ensure that this implementation stays within * the specification by default. * * @param nextUri * The prefixed URI to be written as a sesame qname attribute. */ private void writeQName(IRI nextUri) { if (getWriterConfig().get(BasicQueryWriterSettings.ADD_SESAME_QNAME)) { xmlWriter.setAttribute(QNAME, namespaceTable.get(nextUri.getNamespace()) + ":" + nextUri.getLocalName()); } }
public Value evaluate(Namespace node, BindingSet bindings) throws ValueExprEvaluationException, QueryEvaluationException { Value argValue = evaluate(node.getArg(), bindings); if (argValue instanceof IRI) { IRI uri = (IRI)argValue; return tripleSource.getValueFactory().createIRI(uri.getNamespace()); } else { throw new ValueExprEvaluationException(); } }
public Value evaluate(Namespace node, BindingSet bindings) throws ValueExprEvaluationException, QueryEvaluationException { Value argValue = evaluate(node.getArg(), bindings); if (argValue instanceof IRI) { IRI uri = (IRI)argValue; return tripleSource.getValueFactory().createIRI(uri.getNamespace()); } else { throw new ValueExprEvaluationException(); } }
/** * Write out the closing tag for the subject or object of a statement. */ private void writeNodeEndTag(Node node) throws IOException { if (node.getType() != null) { writeEndTag(node.getType().getNamespace(), node.getType().getLocalName()); } else { writeEndTag(RDF.NAMESPACE, "Description"); } writeNewLine(); }
/** * Write out the closing tag for the subject or object of a statement. */ private void writeNodeEndTag(Node node) throws IOException { if (node.getType() != null) { writeEndTag(node.getType().getNamespace(), node.getType().getLocalName()); } else { writeEndTag(RDF.NAMESPACE, "Description"); } writeNewLine(); }
/** * Write out the closing tag for the subject or object of a statement. */ private void writeNodeEndTag(Node node) throws IOException { if (node.getType() != null) { writeEndTag(node.getType().getNamespace(), node.getType().getLocalName()); } else { writeEndTag(RDF.NAMESPACE, "Description"); } writeNewLine(); }