Skip to content

Commit

Permalink
Add namespace encoder for urn:uuid:.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Hale committed Oct 29, 2023
1 parent 5f30ea5 commit b0ad9bc
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ public final class TableConfig {
static final int VERSION_4_6_1 = 461;
static final int VERSION_4_6_2 = 462;
static final int VERSION_4_7 = 470;
static final int CURRENT_VERSION = VERSION_4_7;
static final int VERSION_4_9 = 490;
static final int CURRENT_VERSION = VERSION_4_9;

public static final String ID_HASH = "halyard.id.hash";
public static final String ID_JAVA_HASH = "halyard.id.javaHash";
Expand Down
15 changes: 15 additions & 0 deletions common/src/main/java/com/msd/gin/halyard/vocab/UUID.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.msd.gin.halyard.vocab;

import com.msd.gin.halyard.common.Vocabulary;

import org.eclipse.rdf4j.model.Namespace;
import org.kohsuke.MetaInfServices;

@MetaInfServices(Vocabulary.class)
public final class UUID implements Vocabulary {
public static final String PREFIX = "uuid";

public static final String NAMESPACE = "urn:uuid:";

public static final Namespace NS = new UUIDNamespace(PREFIX, NAMESPACE);
}
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ private static List<Value> createData(ValueFactory vf) {
vf.createIRI(HALYARD.VALUE_ID_NS.getName(), "eRg5UlsxjZuh-4meqlYQe3-J8X8"),
vf.createIRI(WIKIDATA.WDV_NAMESPACE, "400f9abd3fd761c62af23dbe8f8432158a6ce272"),
vf.createIRI(WIKIDATA.WDV_NAMESPACE, "invalid"),
vf.createIRI(WIKIDATA.WDV_NAMESPACE+"400f9abd3fd761c62af23dbe8f8432158a6ce272/")
vf.createIRI(WIKIDATA.WDV_NAMESPACE+"400f9abd3fd761c62af23dbe8f8432158a6ce272/"),
vf.createIRI("urn:uuid:8104c873-b648-44de-aaee-cb65f1dcafbb")
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ static List<Object[]> createData(ValueFactory vf) {
new Object[] {vf.createIRI(HALYARD.VALUE_ID_NS.getName(), "eRg5UlsxjZuh-4meqlYQe3-J8X8"), ValueIO.ENCODED_IRI_TYPE},
new Object[] {vf.createIRI(WIKIDATA.WDV_NAMESPACE, "400f9abd3fd761c62af23dbe8f8432158a6ce272"), ValueIO.ENCODED_IRI_TYPE},
new Object[] {vf.createIRI(WIKIDATA.WDV_NAMESPACE, "invalid"), ValueIO.NAMESPACE_HASH_TYPE},
new Object[] {vf.createIRI(WIKIDATA.WDV_NAMESPACE+"400f9abd3fd761c62af23dbe8f8432158a6ce272/"), ValueIO.END_SLASH_ENCODED_IRI_TYPE}
new Object[] {vf.createIRI(WIKIDATA.WDV_NAMESPACE+"400f9abd3fd761c62af23dbe8f8432158a6ce272/"), ValueIO.END_SLASH_ENCODED_IRI_TYPE},
new Object[] {vf.createIRI("urn:uuid:8104c873-b648-44de-aaee-cb65f1dcafbb"), ValueIO.ENCODED_IRI_TYPE}
);
}

Expand Down

0 comments on commit b0ad9bc

Please sign in to comment.