@Test void testNormalizeIdentifier() { final IRI iri = rdf.createIRI("trellis:data/resource"); final IRI iriSlash = rdf.createIRI("trellis:data/resource/"); final IRI root = rdf.createIRI("trellis:data/"); assertEquals(iri, Authorization.normalizeIdentifier(rdf.createTriple(subject, ACL.accessTo, iri))); assertEquals(iri, Authorization.normalizeIdentifier(rdf.createTriple(subject, ACL.accessTo, iriSlash))); assertEquals(root, Authorization.normalizeIdentifier(rdf.createTriple(subject, ACL.accessTo, root))); assertNull(Authorization.normalizeIdentifier(rdf.createTriple(subject, ACL.accessTo, rdf.createBlankNode()))); }
static IRI normalizeIdentifier(final Triple triple) { if (triple.getObject() instanceof IRI) { if (triple.getPredicate().equals(ACL.accessTo) || triple.getPredicate().equals(ACL.default_)) { final String obj = ((IRI) triple.getObject()).getIRIString(); if (obj.endsWith("/") && !obj.equals(TRELLIS_DATA_PREFIX)) { return rdf.createIRI(obj.substring(0, obj.length() - 1)); } } return (IRI) triple.getObject(); } return null; }
Authorization { static IRI normalizeIdentifier(final Triple triple) { if (triple.getObject() instanceof IRI) { if (triple.getPredicate().equals(ACL.accessTo) || triple.getPredicate().equals(ACL.default_)) { final String obj = ((IRI) triple.getObject()).getIRIString(); if (obj.endsWith("/") && !obj.equals(TRELLIS_DATA_PREFIX)) { return rdf.createIRI(obj.substring(0, obj.length() - 1)); } } return (IRI) triple.getObject(); } return null; } }
Authorization { static IRI normalizeIdentifier(final Triple triple) { if (triple.getObject() instanceof IRI) { if (triple.getPredicate().equals(ACL.accessTo) || triple.getPredicate().equals(ACL.default_)) { final String obj = ((IRI) triple.getObject()).getIRIString(); if (obj.endsWith("/") && !obj.equals(TRELLIS_DATA_PREFIX)) { return rdf.createIRI(obj.substring(0, obj.length() - 1)); } } return (IRI) triple.getObject(); } return null; } Authorization(final BlankNodeOrIRI identifier, final Graph graph); }
Authorization { static IRI normalizeIdentifier(final Triple triple) { if (triple.getObject() instanceof IRI) { if (triple.getPredicate().equals(ACL.accessTo) || triple.getPredicate().equals(ACL.default_)) { final String obj = ((IRI) triple.getObject()).getIRIString(); if (obj.endsWith("/") && !obj.equals(TRELLIS_DATA_PREFIX)) { return rdf.createIRI(obj.substring(0, obj.length() - 1)); } } return (IRI) triple.getObject(); } return null; } Authorization(final BlankNodeOrIRI identifier, final Graph graph); static Authorization from(final BlankNodeOrIRI identifier, final Graph graph); BlankNodeOrIRI getIdentifier(); Set<IRI> getAgent(); Set<IRI> getAgentClass(); Set<IRI> getAgentGroup(); Set<IRI> getMode(); Set<IRI> getAccessTo(); Set<IRI> getDefault(); }
Authorization { static IRI normalizeIdentifier(final Triple triple) { if (triple.getObject() instanceof IRI) { if (triple.getPredicate().equals(ACL.accessTo) || triple.getPredicate().equals(ACL.default_)) { final String obj = ((IRI) triple.getObject()).getIRIString(); if (obj.endsWith("/") && !obj.equals(TRELLIS_DATA_PREFIX)) { return rdf.createIRI(obj.substring(0, obj.length() - 1)); } } return (IRI) triple.getObject(); } return null; } Authorization(final BlankNodeOrIRI identifier, final Graph graph); static Authorization from(final BlankNodeOrIRI identifier, final Graph graph); BlankNodeOrIRI getIdentifier(); Set<IRI> getAgent(); Set<IRI> getAgentClass(); Set<IRI> getAgentGroup(); Set<IRI> getMode(); Set<IRI> getAccessTo(); Set<IRI> getDefault();  }