X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.graph.db%2Fsrc%2Forg%2Fsimantics%2Fgraph%2Fdb%2FCoreInitialization.java;h=b641490326b4be2c7874cd47d939b6210413f9dc;hb=32a17a670cf4f9d459917495be5f4a504afac205;hp=3e15e4b3141647ac1a21a042049a5cdbb057ce8a;hpb=0ae2b770234dfc3cbb18bd38f324125cf0faca07;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.graph.db/src/org/simantics/graph/db/CoreInitialization.java b/bundles/org.simantics.graph.db/src/org/simantics/graph/db/CoreInitialization.java index 3e15e4b31..b64149032 100644 --- a/bundles/org.simantics.graph.db/src/org/simantics/graph/db/CoreInitialization.java +++ b/bundles/org.simantics.graph.db/src/org/simantics/graph/db/CoreInitialization.java @@ -28,6 +28,10 @@ public class CoreInitialization { } static { + // IMPORTANT NOTICE: + // DO NOT alter the order of these definitions in any way + // unless you deliberately want to make the system incompatible + // with databases that have been created before changing these. addLayer0Builtin("InstanceOf"); addLayer0Builtin("Inherits"); addLayer0Builtin("SubrelationOf"); @@ -49,8 +53,33 @@ public class CoreInitialization { addLayer0Builtin("HasPredicateInverse"); addLayer0Builtin("HasObject"); - addBuiltin("http://Projects"); + // #7016: This bogus URI replaces the builtin entry + // that was originally http://Projects. + // + // addBuiltin("http://Projects") was removed because its existence + // resulted in a non-functioning URI space because: + // + // 1. http://Projects was added as a "built-in resource" when the database + // is first initialized which means that ReadGraph.getResource("http://Projects") + // would succeed even when the resource was not yet properly imported + // from the project ontology. + // + // 2. When the project ontology is imported, a new resource is + // created to represent http://Projects instead of using the existing + // uninitialized "built-in resource". The L0.ExternalEntity changes made + // to the standard transferable graph import in this patch caused the + // code to find the built-in resource for "http://Projects" and think + // that it has to be a resource that's already properly initialized. + // This led to the TG import not initializing the resource at all. + // Previously there was a bug here as well but it was hidden by the fact + // that the system would import the actual/new "http://Projects" + // resource from the ontology anyway. This effectively left the + // uninitialized built-in resource just hanging in the database as + // trash. + //addBuiltin("http://Projects"); + addBuiltin("75e23fb39121b4b37cf2e6a26ccb34c52f77522d-do-not-remove"); addBuiltin("http:/"); + addLayer0Builtin("ExternalEntity"); } public static void initializeBuiltins(Session session) throws DatabaseException {