/** * Implements {@link URI#getLocalName()}. */ @Override public String getLocalName() { return uri.getLocalName(); }
public void addRdfType(URI pred, URI rdfType) { String key = pred.getLocalName(); List<URI> rdfTypes = new ArrayList<URI>(); List<URI> o = predicateRdfTypes.putIfAbsent(key, rdfTypes); if (o != null) { rdfTypes = o; } rdfTypes.add(rdfType); }
@Override public String toString() { final URI s = (URI) stmt.getSubject(); final URI p = (URI) stmt.getPredicate(); final URI o = (URI) stmt.getObject(); return "e["+p.getLocalName()+"]["+s.getLocalName()+"->"+o.getLocalName()+"]"; }
private String getTableAlias(Value predValue) { if (predValue != null) { String localName = ((URI)predValue).getLocalName(); if (localName.length() >= 1) { String alias = localName.substring(0, 1); if (isLetters(alias)) { return alias; } } } return ALIAS; }
public boolean equals(Object o) { if (this == o) { return true; } if (o instanceof URI) { URI other = (URI)o; return _localName.equals(other.getLocalName()) && _namespace.equals(other.getNamespace()); } return false; }
@Override public int compare(PropertyConstraint a, PropertyConstraint b) { return a.getPredicate().getLocalName().compareTo(b.getPredicate().getLocalName()); } });
@Override public String toAvroFullName(URI rdfName) { StringBuilder builder = new StringBuilder(); appendAvroNamespace(builder, rdfName.getNamespace()); builder.append('.'); builder.append(rdfName.getLocalName()); return builder.toString(); }
@Override public String enumName(String recordName, PropertyConstraint constraint) { StringBuilder builder = new StringBuilder(); builder.append(StringUtil.capitalize(constraint.getPredicate().getLocalName())); builder.append("Enum"); return builder.toString(); }
@Override public String jsonSchemaFileName(Shape shape) { URI shapeId = (URI) shape.getId(); StringBuilder builder = new StringBuilder(); builder.append(namespace(shapeId).getPrefix()); builder.append('.'); builder.append(shapeId.getLocalName()); builder.append(".json"); return builder.toString(); }
private String jsonSchemaLocalName(Shape shape) { Resource shapeId = shape.getId(); if (shapeId instanceof URI) { URI uri = (URI) shapeId; return uri.getLocalName(); } String iri = namer.schemaId(shape); URI uri = new URIImpl(iri); return uri.getLocalName(); }
public String toExternal(final URI uri) { if (prefixDecls != null) { final String prefix = namespaces.get(uri.getNamespace()); if (prefix != null) { return prefix + ":" + uri.getLocalName(); } } return "<" + uri.stringValue() + ">"; }
/** * Implements {@link URI#getLocalName()}. */ public String getLocalName() { if (!isURI()) throw new ClassCastException(); return ((URI) getValue()).getLocalName(); }
/** * Implements {@link URI#getLocalName()}. */ public String getLocalName() { if (!isURI()) throw new ClassCastException(); return ((URI) getValue()).getLocalName(); }
private void setTemplateShape(TransformAttribute attr, MappedProperty m, String targetContext, Shape valueShape, IriTemplateInfo info) { StringBuilder nextContext = new StringBuilder(); nextContext.append(targetContext); nextContext.append('.'); nextContext.append(attr.getPredicate().getLocalName()); ShapePath nextShape = new ShapePath(nextContext.toString(), valueShape); m.setTemplateShape(nextShape); m.setTemplateInfo(info); }
public static GoogleCloudSqlInstanceType fromLocalName(String localName) { for (GoogleCloudSqlInstanceType value : values()) { if (value.getURI().getLocalName().equals(localName)) { return value; } } throw new KonigException("Value not found: " + localName); }
private void emitURI(final URI uri) throws IOException { final String prefix = this.prefixes.get(uri.getNamespace()); this.writer.append('\"'); if (prefix != null) { emitString(prefix); this.writer.append(':'); emitString(uri.getLocalName()); } else { emitString(uri.stringValue()); } this.writer.append('\"'); }
@Override public void emit(Graph graph) throws IOException, KonigException { TurtleGenerator generator = new TurtleGenerator(); try { generator.generateAll(owlClass, outDir, graph, context); } catch (RDFHandlerException e) { throw new KonigException("Failed to generate all instances of " + owlClass.getLocalName()); } }
private List<ColumnExpression> columnList(TransformFrame frame) { List<ColumnExpression> list = new ArrayList<>(); if (frame.getTargetShape().getNodeKind()==NodeKind.IRI) { list.add(new ColumnExpression(idColumnName)); } for (TransformAttribute attr : frame.getAttributes()) { String columnName = attr.getPredicate().getLocalName(); list.add(new ColumnExpression(columnName)); } return list; }
public String getMethodName(URI name) { String ns = name.getNamespace(); String localPart = name.getLocalName(); if (prefixes.containsKey(ns)) return word(getMemberPrefix(ns) + initcap(localPart)); return word(localPart); }
public String getPluralParameterName(URI name) { String ns = name.getNamespace(); String localPart = name.getLocalName(); String plural = plural(localPart); if (model.contains(new URIImpl(ns + plural), null, null)) { plural = localPart; } return word(plural); }