X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.scl.db%2Fscl%2FSimantics%2FDB.scl;h=b69119eae0e345b65f153961cb289f85c752d63a;hb=e5c9ce2de1b970b17c3ffc1151d7c49743df6183;hp=adc72bb943e1cd0a788eaa4369be8deb10b36861;hpb=1dfc44ff89362fb4500ee9427432541b92d1953f;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.scl.db/scl/Simantics/DB.scl b/bundles/org.simantics.scl.db/scl/Simantics/DB.scl index adc72bb94..b69119eae 100644 --- a/bundles/org.simantics.scl.db/scl/Simantics/DB.scl +++ b/bundles/org.simantics.scl.db/scl/Simantics/DB.scl @@ -250,13 +250,6 @@ importJava "org.simantics.db.WriteGraph" where @JavaName denyValue denyValue :: Resource -> () -claimAssertion :: Resource -> Resource -> Resource -> () -claimAssertion type_ predicate object = do - ass = newResource () - claim ass L0.HasPredicate predicate - claim ass L0.HasObject object - claim type_ L0.Asserts ass - "Sets the value of the literal that is an object with the given subject and predicate." @inline claimRelatedValue :: Serializable a => Resource -> Resource -> a -> () @@ -305,26 +298,35 @@ importJava "org.simantics.db.common.utils.OrderedSetUtils" where elementsOfOrderedSet :: Resource -> [Resource] importJava "org.simantics.db.common.utils.ListUtils" where + "`elementsOfList l` returns elements of list `l`" @JavaName toList elementsOfList :: Resource -> [Resource] + "`createList [e]` creates a new list containing elements `[e]`" @JavaName create createList :: [Resource] -> Resource + "`createListWithType t [e]` creates a new list with type `t` containing elements `[e]`" @JavaName create createListWithType :: Resource -> [Resource] -> Resource - @javaName insertBack - insertBack :: Resource -> [Resource] -> () + "`insertListBack l [e]` inserts elements `[e]` back to the list `l`" + @JavaName insertBack + insertListBack :: Resource -> [Resource] -> () + + "`insertListFront l [e]` inserts elements `[e]` front of the list `l`" + @JavaName insertFront + insertListFront :: Resource -> [Resource] -> () - @javaName removeElement - removeElement :: Resource -> Resource -> Boolean + "`removeListElement l e` removes a element `e` from the list `l`" + @JavaName removeElement + removeListElement :: Resource -> Resource -> Boolean - @javaName swapWithPrevious - swapWithPrevious :: Resource -> Resource -> Boolean + @JavaName swapWithPrevious + swapListElementWithPrevious :: Resource -> Resource -> Boolean - @javaName swapWithNext - swapWithNext :: Resource -> Resource -> Boolean + @JavaName swapWithNext + swapListElementWithNext :: Resource -> Resource -> Boolean importJava "org.simantics.db.common.utils.CommonDBUtils" where @@ -406,6 +408,9 @@ importJava "org.simantics.db.layer0.util.Layer0Utils" where addMetadataListener :: ChangeListener -> () removeMetadataListener :: ChangeListener -> () + @JavaName assert_ + claimAssertion :: Resource -> Resource -> Resource -> () + copyTo :: Resource -> Resource -> Resource copyTo targetContainer source = do (collectionToList $ copyTo_ targetContainer source)!0