private static String prettyFormat(final RyaStatement statement) { final RyaIRI s = statement.getSubject(); final RyaIRI p = statement.getPredicate(); final RyaType o = statement.getObject(); return "<" + s.getData() + "> <"+ p.getData() + "> <" + o.getData() + ">"; }
private static int getKey(RyaSubGraph subgraph) { int key = 0; for(RyaStatement statement: subgraph.getStatements()) { key += statement.getObject().hashCode(); } return key; }
private RyaStatement getStatement(final String s, final String p, final String o) { final RyaStatementBuilder builder = new RyaStatementBuilder(); if (s != null) { builder.setSubject(new RyaIRI(s)); } if (p != null) { builder.setPredicate(new RyaIRI(p)); } if (o != null) { builder.setObject(new RyaIRI(o)); } return builder.build(); }
/** * Creates a string {@link RyaType} object. * @param value the {@link String} object. * @return the {@link RyaType} with the data type set to * {@link XMLSchema#STRING} and the data set to the specified {@code value}. */ public static RyaType stringRyaType(final String value) { return new RyaType(XMLSchema.STRING, value); }
@Override public int hashCode() { if (ryatype == null) { return 0; } else { return ryatype.hashCode(); } } }
@Override public RyaType newInstance() { return new RyaURI(); } }
public void testPrefix() throws Exception { String prefix = "urn:test#"; RyaIRIPrefix iriPrefix = new RyaIRIPrefix(prefix); assertEquals(prefix, iriPrefix.getPrefix()); } }
private static int getKey(RyaSubGraph subgraph) { int key = 0; for(RyaStatement statement: subgraph.getStatements()) { key += statement.getObject().hashCode(); } return key; }