Navigation Menu

Skip to content

Commit

Permalink
use VANN vocabulary for namespace registry
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeer committed Jul 22, 2013
1 parent a6b8ff1 commit 9fca5ff
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fcrepo-kernel/src/main/java/org/fcrepo/RdfLexicon.java
Expand Up @@ -88,7 +88,9 @@ public final class RdfLexicon {

// NAMESPACES
public static final Property HAS_NAMESPACE_PREFIX =
createProperty(INTERNAL_NAMESPACE + "hasNamespace");
createProperty("http://purl.org/vocab/vann/preferredNamespacePrefix");
public static final Property HAS_NAMESPACE_URI =
createProperty("http://purl.org/vocab/vann/preferredNamespaceUri");


// OTHER SERVICES
Expand Down
4 changes: 4 additions & 0 deletions fcrepo-kernel/src/main/java/org/fcrepo/utils/JcrRdfTools.java
Expand Up @@ -234,6 +234,10 @@ public static Model getJcrNamespaceModel(final Session session)
model.add(ResourceFactory.createResource(entry.getValue()),
RdfLexicon.HAS_NAMESPACE_PREFIX, ResourceFactory
.createPlainLiteral(entry.getKey()));

model.add(ResourceFactory.createResource(entry.getValue()),
RdfLexicon.HAS_NAMESPACE_URI, ResourceFactory
.createPlainLiteral(entry.getValue()));

This comment has been minimized.

Copy link
@awoods

awoods Jul 24, 2013

Should this be: entry.getKey() instead of entry.getValue()?

This comment has been minimized.

Copy link
@cbeer

cbeer Jul 26, 2013

Author Contributor

No. Here's the current, expected output for a real namespace:

http://www.w3.org/2001/XMLSchema-instance http://purl.org/vocab/vann/preferredNamespacePrefix "xsi" .
    http://purl.org/vocab/vann/preferredNamespaceUri "http://www.w3.org/2001/XMLSchema-instance"
    http://www.w3.org/1999/02/22-rdf-syntax-ns#type http://purl.org/vocommons/voaf#Vocabulary
}

return model;
Expand Down
Expand Up @@ -45,6 +45,7 @@
import static org.fcrepo.RdfLexicon.HAS_LOCATION;
import static org.fcrepo.RdfLexicon.HAS_MEMBER_OF_RESULT;
import static org.fcrepo.RdfLexicon.HAS_NAMESPACE_PREFIX;
import static org.fcrepo.RdfLexicon.HAS_NAMESPACE_URI;
import static org.fcrepo.RdfLexicon.HAS_VERSION;
import static org.fcrepo.RdfLexicon.HAS_VERSION_LABEL;
import static org.fcrepo.RdfLexicon.IS_FIXITY_RESULT_OF;
Expand Down Expand Up @@ -916,6 +917,10 @@ public void testGetJcrNamespaceModel() throws Exception {
assertTrue(jcrNamespaceModel.contains(
createResource("registered-uri#"), HAS_NAMESPACE_PREFIX,
"some-prefix"));

assertTrue(jcrNamespaceModel.contains(
createResource("registered-uri#"), HAS_NAMESPACE_URI,
"registered-uri#"));
}

@Test
Expand Down

0 comments on commit 9fca5ff

Please sign in to comment.