[Mulgara-svn] r924 - trunk/src/jar/resolver-nodetype/java/org/mulgara/resolver/nodetype
pag at mulgara.org
pag at mulgara.org
Wed May 14 03:43:01 UTC 2008
Author: pag
Date: 2008-05-13 20:43:00 -0700 (Tue, 13 May 2008)
New Revision: 924
Modified:
trunk/src/jar/resolver-nodetype/java/org/mulgara/resolver/nodetype/NodeTypeResolverFactory.java
Log:
Added support for default graph creation and changed model to graph
Modified: trunk/src/jar/resolver-nodetype/java/org/mulgara/resolver/nodetype/NodeTypeResolverFactory.java
===================================================================
--- trunk/src/jar/resolver-nodetype/java/org/mulgara/resolver/nodetype/NodeTypeResolverFactory.java 2008-05-14 03:40:25 UTC (rev 923)
+++ trunk/src/jar/resolver-nodetype/java/org/mulgara/resolver/nodetype/NodeTypeResolverFactory.java 2008-05-14 03:43:00 UTC (rev 924)
@@ -69,8 +69,11 @@
/** The URI for the modelType. */
- private static final URI modelTypeURI = URI.create(Mulgara.NAMESPACE + "TypeModel");
+ private static final URI graphTypeURI = URI.create(Mulgara.NAMESPACE + "TypeGraph");
+ /** The URI for the default graph. */
+ private static final URI DEFAULT_GRAPH = URI.create(Mulgara.NODE_TYPE_GRAPH);
+
/** The URI for the internal URI reference type. */
private static final URI mulgaraUriReferenceURI = URI.create(Mulgara.NAMESPACE + "uriReference");
@@ -99,13 +102,12 @@
// intialize the fields
rdfType = initializer.preallocate(new URIReferenceImpl(RDF.TYPE));
- modelType = initializer.preallocate(new URIReferenceImpl(modelTypeURI));
+ modelType = initializer.preallocate(new URIReferenceImpl(graphTypeURI));
rdfsLiteral = initializer.preallocate(new URIReferenceImpl(RDFS.LITERAL));
mulgaraUriReference = initializer.preallocate(new URIReferenceImpl(mulgaraUriReferenceURI));
systemModel = initializer.getSystemModel();
- // Claim the type supported by the resolver
- initializer.addModelType(modelTypeURI, this);
+ // No need to claim the type supported by the resolver as this is detected in the default graph
}
//
@@ -127,6 +129,13 @@
}
/**
+ * @return The default graph for this resolver.
+ */
+ public Graph[] getDefaultGraphs() {
+ return new Graph[] { new Graph(DEFAULT_GRAPH, graphTypeURI) };
+ }
+
+ /**
* Register this resolver upon database startup.
*
* @param resolverFactoryInitializer the database within which to find or
@@ -157,7 +166,7 @@
if (logger.isDebugEnabled()) logger.debug("Creating new node type resolver");
return new NodeTypeResolver(
resolverSession, systemResolver, rdfType, systemModel,
- rdfsLiteral, mulgaraUriReference, modelType, modelTypeURI
+ rdfsLiteral, mulgaraUriReference, modelType, graphTypeURI
);
}
}
More information about the Mulgara-svn
mailing list