public static org.fcrepo.server.types.gen.RelationshipTuple convertRelsTupleToGenRelsTuple(org.fcrepo.server.storage.types.RelationshipTuple in) { if (in == null) { return null; } org.fcrepo.server.types.gen.RelationshipTuple out = new org.fcrepo.server.types.gen.RelationshipTuple(); out.setSubject(in.subject); out.setPredicate(in.predicate); out.setObject(in.object); out.setIsLiteral(in.isLiteral); if (in.datatype == null) out.setDatatype(null); else out.setDatatype(in.datatype.toString()); return out; }
private void getRelationship(String subject, String predicate, String object, boolean isLiteral, String datatype) throws Exception { addRelationship(subject, predicate, object, isLiteral, datatype); List<RelationshipTuple> tuples = apim.getRelationships(subject, predicate); assertNotNull(tuples); assertEquals(1, tuples.size()); assertEquals(subjectAsURI(subject), tuples.get(0).getSubject()); assertEquals(predicate, tuples.get(0).getPredicate()); assertEquals(object, tuples.get(0).getObject()); assertEquals(isLiteral, tuples.get(0).isIsLiteral()); assertEquals(datatype, tuples.get(0).getDatatype()); }
private void checkExistsViaGetRelationships(String subject, String predicate, String object) throws Exception { boolean found = false; for (RelationshipTuple tuple : apim .getRelationships(subject, predicate)) { if (tuple.getSubject().equals(subjectAsURI(subject)) && tuple.getPredicate().equals(predicate) && tuple.getObject().equals(object)) { found = true; } } assertTrue("Relationship not found via getRelationships (subject=" + subject + ", predicate=" + predicate + ", object=" + object, found); }
/** * Convert a WSDL-style {@link RelationshipTuple RelationshipTuple} into a * local {@link RelationshipInfo}. */ public static RelationshipInfo convertGenRelsTupleToRelationshipInfo(RelationshipTuple genTuple) { return new RelationshipInfo(genTuple.getPredicate(), genTuple .getObject()); }
/** * Create an instance of {@link RelationshipTuple } * */ public RelationshipTuple createRelationshipTuple() { return new RelationshipTuple(); }
/** * Create an instance of {@link RelationshipTuple } * */ public RelationshipTuple createRelationshipTuple() { return new RelationshipTuple(); }
public static org.fcrepo.server.types.gen.RelationshipTuple convertRelsTupleToGenRelsTuple(org.fcrepo.server.storage.types.RelationshipTuple in) { if (in == null) { return null; } org.fcrepo.server.types.gen.RelationshipTuple out = new org.fcrepo.server.types.gen.RelationshipTuple(); out.setSubject(in.subject); out.setPredicate(in.predicate); out.setObject(in.object); out.setIsLiteral(in.isLiteral); if (in.datatype == null) out.setDatatype(null); else out.setDatatype(in.datatype.toString()); return out; }