X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.scl.db%2Fscl%2FSimantics%2FDB.scl;h=b24df17f8639c40cb2a020f130a911e8bf547912;hp=b725d6c74afca7914d62fb38909fb1a85c7e4209;hb=82a87b8535628d47d9c381e1a3a2296fb67c7fd0;hpb=d5c76b143c0000994bb76c40f0ea74354eb5ce8a diff --git a/bundles/org.simantics.scl.db/scl/Simantics/DB.scl b/bundles/org.simantics.scl.db/scl/Simantics/DB.scl index b725d6c74..b24df17f8 100644 --- a/bundles/org.simantics.scl.db/scl/Simantics/DB.scl +++ b/bundles/org.simantics.scl.db/scl/Simantics/DB.scl @@ -140,6 +140,9 @@ importJava "org.simantics.db.ReadGraph" where isInheritedFrom :: Resource -> Resource -> Boolean getRootLibrary :: () -> Resource + + @JavaName getPredicates + predicatesOf :: Resource -> [Resource] importJava "org.simantics.db.layer0.util.ExtendedUris" where "Converts an absolute URI to a resource" @@ -265,6 +268,9 @@ importJava "org.simantics.db.common.utils.ListUtils" where @JavaName create createList :: [Resource] -> Resource + + @JavaName create + createListWithType :: Resource -> [Resource] -> Resource @javaName insertBack insertBack :: Resource -> [Resource] -> () @@ -343,6 +349,7 @@ importJava "org.simantics.db.layer0.util.Layer0Utils" where listOntologies :: () -> [Resource] emptyTrashBin :: () -> () purgeDatabase :: () -> () + prettyPrintResource :: Resource -> Boolean -> String @private @JavaName copyTo @@ -421,6 +428,10 @@ currentModel = match activeModel (currentProject ()) with Just model -> model Nothing -> fail "No active model." +"Gives the current active model if it exists or Nothing otherwise." +possibleCurrentModel :: Maybe Resource +possibleCurrentModel = activeModel (currentProject ()) + startUndoPoint :: String -> () startUndoPoint string = do markUndoPoint () @@ -473,4 +484,4 @@ possibleChildWithPath parent path = Just c -> possibleChild c name Nothing -> Nothing ) - (Just parent) path + (Just parent) path \ No newline at end of file