@Override protected boolean accept(Resource object) throws SailException { return !object.stringValue().equals(defaultContext); } };
@Override protected boolean accept(Resource object) throws SailException { return !object.stringValue().equals(defaultContext); } };
private String getValue(Resource r) throws RDFHandlerException { if (r instanceof URI) { return r.stringValue(); } else if (r instanceof BNode) { return "_:" + r.stringValue(); } else if (r == null) { return null; } throw new RDFHandlerException("Can not recognize resource type."); } }
@Override public String schemaId(Shape shape) { String shapeId = shape.getId().stringValue(); return shapeId + idSuffix; }
@Override public String getContentType(Resource resource) { // iterate over all possible writers; if the pattern matches, try to store the content and return for(Pattern p : readerMap.keySet()) { if(p.matcher(resource.stringValue()).matches()) { ContentReader reader = readerMap.get(p); return reader.getContentType(resource); } } return null; }
protected void appendProperties(StringBuilder builder) { builder.append("shape.id="); builder.append(shape.getId().stringValue()); } public DataChannel getDataChannel() {
@Override public String apply(Resource input) { return input.stringValue(); } }
@Override public String apply(Resource input) { return input.stringValue(); } }
private boolean isParameter(Resource prop) { return !model.contains(prop, RDF.TYPE, OWL.ANNOTATIONPROPERTY) && prop instanceof URI && !prop.stringValue().startsWith(MSG.NAMESPACE); }
@Override public String schemaId(Shape shape) { String shapeId = shape.getId().stringValue(); return shapeId + idSuffix; }
public <T> T getProperty(final String key) { if (key.equals(SailTokens.NAMED_GRAPH)) { Resource resource = this.rawEdge.getContext(); if (null == resource) return null; else return (T) resource.stringValue(); } else return null; }
private String tableKey(String tableId, Shape shape) { Resource shapeId = shape.getId(); if (shapeId == null) { throw new KonigException("Shape id must not be null for table: " + tableId); } StringBuilder builder = new StringBuilder(); builder.append(tableId); builder.append('|'); builder.append(shapeId.stringValue()); return builder.toString(); }
@Nonnull protected Id findId (final @Nonnull List<Statement> statements, final @Nonnull Context context) { return new Id(statements.get(0).getSubject().stringValue()); } }
@Nonnull protected Id findId (final @Nonnull List<Statement> statements, final @Nonnull Context context) { return new Id(statements.get(0).getSubject().stringValue()); }
@Override public int compare(Vertex a, Vertex b) { Resource aId = a.getId(); Resource bId = b.getId(); String aString = (aId instanceof URI) ? ((URI)aId).getLocalName() : aId.stringValue(); String bString = (bId instanceof URI) ? ((URI)bId).getLocalName() : bId.stringValue(); return aString.compareTo(bString); }
@Override public boolean accept(Statement object) { return !(object.getContext() != null && configurationService.getCacheContext().equals(object.getContext().stringValue())); } };
@Override public int compare(Vertex a, Vertex b) { Value aPrefix = a.getValue(VANN.preferredNamespacePrefix); Value bPrefix = b.getValue(VANN.preferredNamespacePrefix); String aValue = aPrefix==null ? a.getId().stringValue() : aPrefix.stringValue(); String bValue = bPrefix==null ? b.getId().stringValue() : bPrefix.stringValue(); return aValue.compareTo(bValue); }
public void generateIDL(Shape shape, PrintWriter out) throws SchemaGeneratorException { Worker worker = new Worker(out); try { worker.generate(shape); out.flush(); } catch (IOException e) { throw new SchemaGeneratorException("Failed to generate Avro IDL for " + shape.getId().stringValue()); } }
protected Shape getShape(String tableName,ShapeManager shapeManager) { List<Shape> shapes= shapeManager.listShapes(); for(Shape shape : shapes) { String localName = new URIImpl(shape.getId().stringValue()).getLocalName(); if(tableName.equals(localName)) { return shape; } } return null; }
public static RelationshipTuple fromNodes(org.openrdf.model.Resource s, org.openrdf.model.URI p, org.openrdf.model.Value o, GraphElementFactory u) { String subject = s.stringValue(); String predicate = p.stringValue(); // the rdf streams parsed by Fedora will only contain URIs and Literals, no BNodes if (o instanceof org.openrdf.model.Literal) { return getLiteral(subject, predicate, (org.openrdf.model.Literal)o); } else { return new RelationshipTuple(subject, predicate, o.stringValue(), false, null, null); } }