@Override public String getLocalName() { return impl.getLocalName(); }
@Override public int compare(IRI uri1, IRI uri2) { return uri1.getLocalName().compareTo(uri2.getLocalName()); } });
/** * Returns a prefixed name representation of the specific datatype that this function returns * * @return a prefixed name, e.g. 'xsd:integer'. */ protected String getXsdName() { return "xsd:" + getXsdDatatype().getLocalName(); }
/** * Returns a prefixed name representation of the specific datatype that this function returns * * @return a prefixed name, e.g. 'xsd:integer'. */ protected String getXsdName() { return "xsd:" + getXsdDatatype().getLocalName(); }
private static String addTypePrefixToUri(final String uriString, final String typePrefix) { final String localName = VF.createIRI(uriString).getLocalName(); final String beginning = StringUtils.removeEnd(uriString, localName); final String formattedUriString = beginning + typePrefix + localName; return formattedUriString; }
private static String removeTypePrefixFromUri(final String uriString, final String typePrefix) { final String localName = VF.createIRI(uriString).getLocalName(); final String beginning = StringUtils.removeEnd(uriString, localName); final String replacement = localName.replaceFirst(typePrefix + ".", ""); final String formattedUriString = beginning + replacement; return formattedUriString; }
private static void addBindings(Query query, List<Argument> arguments, Value... args) { for (int i = 0; i < args.length; i++) { Argument argument = arguments.get(i); query.setBinding(argument.getPredicate().getLocalName(), args[i]); } } }
private static void addBindings(Query query, List<Argument> arguments, Value... args) { for (int i = 0; i < args.length; i++) { Argument argument = arguments.get(i); query.setBinding(argument.getPredicate().getLocalName(), args[i]); } } }
private static String getShortNameForType(final RyaIRI type) throws SmartUriException { final String shortName = VF.createIRI(type.getData()).getLocalName(); return shortName; }
private String getLabel(KBObject aKbObject) { if (aKbObject != null) { return aKbObject.getUiLabel(); } return ((IRI) getModelObject().getValue()).getLocalName(); }
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(); } }
private String getLabel(KBObject aKbObject) { if (aKbObject != null) { return aKbObject.getUiLabel(); } return ((IRI) getModelObject().getValue()).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(LocalName node, BindingSet bindings) throws ValueExprEvaluationException, QueryEvaluationException { Value argValue = evaluate(node.getArg(), bindings); if (argValue instanceof IRI) { IRI uri = (IRI)argValue; return tripleSource.getValueFactory().createLiteral(uri.getLocalName()); } else { throw new ValueExprEvaluationException(); } }
public Value evaluate(LocalName node, BindingSet bindings) throws ValueExprEvaluationException, QueryEvaluationException { Value argValue = evaluate(node.getArg(), bindings); if (argValue instanceof IRI) { IRI uri = (IRI)argValue; return tripleSource.getValueFactory().createLiteral(uri.getLocalName()); } 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(); }
private long subsetTriplesPart(IRI graph, IRI partitionType, Var partitionVar, long defaultCardinality) { if (partitionVar == null || !partitionVar.hasValue()) { return defaultCardinality; } return getTriplesCount(SimpleValueFactory.getInstance().createIRI(graph.stringValue() + "_" + partitionType.getLocalName() + "_" + HalyardTableUtils.encode(HalyardTableUtils.hashKey(partitionVar.getValue()))), 100l); } }