@Test void testNormalizeIdentifier() { final IRI root = rdf.createIRI(TRELLIS_DATA_PREFIX); final IRI resource = rdf.createIRI(TRELLIS_DATA_PREFIX + "resource"); final IRI resourceSlash = rdf.createIRI(TRELLIS_DATA_PREFIX + "resource/"); final IRI resourceSlashQuery = rdf.createIRI(TRELLIS_DATA_PREFIX + "resource/?ext=description"); final IRI child = rdf.createIRI("trellis:data/resource/child"); final IRI childHash = rdf.createIRI("trellis:data/resource/child#hash"); final IRI childSlashHash = rdf.createIRI("trellis:data/resource/child/#hash"); final IRI childSlashQueryHash = rdf.createIRI("trellis:data/resource/child/?ext=acl#hash"); assertEquals(root, TrellisUtils.normalizeIdentifier(root)); assertEquals(resource, TrellisUtils.normalizeIdentifier(resource)); assertEquals(resource, TrellisUtils.normalizeIdentifier(resourceSlash)); assertEquals(resource, TrellisUtils.normalizeIdentifier(resourceSlashQuery)); assertEquals(child, TrellisUtils.normalizeIdentifier(child)); assertEquals(child, TrellisUtils.normalizeIdentifier(childHash)); assertEquals(child, TrellisUtils.normalizeIdentifier(childSlashHash)); assertEquals(child, TrellisUtils.normalizeIdentifier(childSlashQueryHash)); }
public static IRI normalizeIdentifier(final IRI identifier) { final String iri = identifier.getIRIString(); if (iri.contains("#") || iri.contains("?") || iri.endsWith(SLASH)) { return rdf.createIRI(normalizeIdentifier(iri)); } return identifier; }
TrellisUtils { public static IRI normalizeIdentifier(final IRI identifier) { final String iri = identifier.getIRIString(); if (iri.contains("#") || iri.contains("?") || iri.endsWith(SLASH)) { return rdf.createIRI(normalizeIdentifier(iri)); } return identifier; } }
TrellisUtils { public static IRI normalizeIdentifier(final IRI identifier) { final String iri = identifier.getIRIString(); if (iri.contains("#") || iri.contains("?") || iri.endsWith(SLASH)) { return rdf.createIRI(normalizeIdentifier(iri)); } return identifier; } private  TrellisUtils(); }
TrellisUtils { public static IRI normalizeIdentifier(final IRI identifier) { final String iri = identifier.getIRIString(); if (iri.contains("#") || iri.contains("?") || iri.endsWith(SLASH)) { return rdf.createIRI(normalizeIdentifier(iri)); } return identifier; } private  TrellisUtils(); static Optional<IRI> getContainer(final IRI identifier); static IRI normalizeIdentifier(final IRI identifier); static IRI buildTrellisIdentifier(final String path); static String normalizePath(final String path); static Collector<Triple, ?, Graph> toGraph(); static DatasetCollector toDataset(); }
TrellisUtils { public static IRI normalizeIdentifier(final IRI identifier) { final String iri = identifier.getIRIString(); if (iri.contains("#") || iri.contains("?") || iri.endsWith(SLASH)) { return rdf.createIRI(normalizeIdentifier(iri)); } return identifier; } private  TrellisUtils(); static Optional<IRI> getContainer(final IRI identifier); static IRI normalizeIdentifier(final IRI identifier); static IRI buildTrellisIdentifier(final String path); static String normalizePath(final String path); static Collector<Triple, ?, Graph> toGraph(); static DatasetCollector toDataset(); static final String TRELLIS_SCHEME; static final String TRELLIS_DATA_PREFIX; static final String TRELLIS_BNODE_PREFIX; static final String TRELLIS_SESSION_PREFIX; static final String TRELLIS_ADMIN_ROLE; }