|
Contents
DB module documentationdata Resource A resource is a node in a semantic graph. ReadingURIsresource :: String -> <ReadGraph> Resource Converts an absolute URI to a resource possibleResource :: String -> <ReadGraph> Maybe Resource Converts an absolute URI to a resource or returns relativeResource :: Resource -> String -> <ReadGraph> Resource Converts a relative URI to a resource starting from the given resource Graph hierarchyclass Browsable a fromUri :: Browsable a => String -> <ReadGraph> a uriOf :: Browsable a => a -> <ReadGraph> String Returns the URI of the given value. possibleUriOf :: Browsable a => a -> <ReadGraph> Maybe String Returns the URI of the given value if it exists or Nothing. nameOf :: Browsable a => a -> <ReadGraph> String Reads the name of the value. possibleNameOf :: Browsable a => a -> <ReadGraph> Maybe String valueOf :: Browsable a => Serializable b => a -> <ReadGraph> b genericRelatedValue :: Browsable a => a -> Resource -> <ReadGraph> b genericPossibleRelatedValue :: Browsable a => a -> Resource -> <ReadGraph> Maybe b variantValueOf :: Browsable a => a -> <ReadGraph> Variant children :: Browsable a => a -> <ReadGraph> [a] parent :: Browsable a => a -> <ReadGraph> a possibleParent :: Browsable a => a -> <ReadGraph> Maybe a child :: Browsable a => a -> String -> <ReadGraph> a possibleChild :: Browsable a => a -> String -> <ReadGraph> Maybe a childWithPath :: Browsable a => a -> [String] -> <ReadGraph> a Returns a child Browsable of the specified parent that has that is the child of the specified parent with the specified name path. possibleChildWithPath :: Browsable a => a -> [String] -> <ReadGraph> Maybe a Like Objects(#) :: Resource -> Resource -> <ReadGraph> [Resource]
singleObject :: Resource -> Resource -> <ReadGraph> Resource Assumes that there is exactly one object with the given subject and predicate and returns it. possibleObject :: Resource -> Resource -> <ReadGraph> Maybe Resource If there is exactly one object with the given possibleObjectWithType :: Resource -> Resource -> Resource -> <ReadGraph> Maybe Resource objectsWithType :: Resource -> Resource -> Resource -> <ReadGraph> [Resource] assertedObjects :: Resource -> Resource -> <ReadGraph> [Resource] assertedObjects subject predicate` returns all asserted objects defined in the specified subjects with the given predicate. Statementsdata Statement A statement is an edge in a semantic graph. subjectOf :: Statement -> Resource predicateOf :: Statement -> Resource objectOf :: Statement -> Resource statements :: Resource -> Resource -> <ReadGraph> [Statement] statements subject predicate` returns all statements with the given subject and predicate. singleStatement :: Resource -> Resource -> <ReadGraph> Statement Assumes that there is exactly one statement with the given subject and predicate and returns it. assertedStatements :: Resource -> Resource -> <ReadGraph> [Statement] assertedStatements subject predicate` returns all asserted statements defined in the specified subjects with the given predicate. isAsserted :: Statement -> Resource -> <ReadGraph> Boolean Special objectssingleTypeOf :: Resource -> Resource -> <ReadGraph> Resource possibleTypeOf :: Resource -> Resource -> <ReadGraph> Maybe Resource inverseOf :: Resource -> <ReadGraph> Resource possibleInverseOf :: Resource -> <ReadGraph> Maybe Resource superTypesOf :: Resource -> <ReadGraph> Set.T Resource superRelationsOf :: Resource -> <ReadGraph> Set.T Resource LiteralspossibleRelatedValue :: Serializable a => Resource -> Resource -> <ReadGraph> Maybe a untypedValueOf :: Resource -> <ReadGraph> Dynamic untypedRelatedValue :: Resource -> Resource -> <ReadGraph> a untypedPossibleRelatedValue :: Resource -> Resource -> <ReadGraph> Maybe a PredicatesisInstanceOf :: Resource -> Resource -> <ReadGraph> Boolean
isSubrelationOf :: Resource -> Resource -> <ReadGraph> Boolean isInheritedFrom :: Resource -> Resource -> <ReadGraph> Boolean isParent :: Resource -> Resource -> <ReadGraph> Boolean existsStatement :: Resource -> Resource -> <ReadGraph> Boolean existsStatement3 :: Resource -> Resource -> Resource -> <ReadGraph> Boolean predicatesOf :: Resource -> <ReadGraph> [Resource] possiblePredicateByName :: Resource -> String -> <ReadGraph> Maybe Resource possiblePredicateByNameFromType :: Resource -> String -> <ReadGraph> Maybe Resource isAsserted :: Statement -> Resource -> <ReadGraph> Boolean Special resourcescurrentModel :: <ReadGraph> Resource Gives the current active model. currentProject :: () -> Resource getRootLibrary :: () -> <ReadGraph> Resource listOntologies :: () -> <ReadGraph> [Resource] possibleCurrentModel :: <ReadGraph> Maybe Resource Gives the current active model if it exists or Nothing otherwise. Resource idresourceId :: Resource -> Long Returns the 64-bit unique identifier of the resource. resourceFromId :: Long -> <ReadGraph> Resource Queriessubquery :: <ReadGraph,Proc> a -> <ReadGraph,Proc> a Makes a new read request with given procedure for calculating the result. The request is cached only if the current request is listened. subqueryA :: <ReadGraph,AsyncReadGraph,Proc> a -> <ReadGraph,Proc> a Performs synchronously a new AsyncRead request. subqueryC :: <ReadGraph,Proc> a -> <ReadGraph,Proc> a Makes a new read request with given procedure for calculating the result. The request is always cached. subqueryL :: <ReadGraph,Proc> a -> (a -> <ReadGraph,b> ()) -> (Throwable -> <ReadGraph,b> ()) -> <b> Boolean -> <ReadGraph,Proc,b> () Makes a new read asynchronous request with function to handle the request result. The last subqueryP :: <ReadGraph,Proc> a -> (a -> <ReadGraph,b> ()) -> (Throwable -> <ReadGraph,b> ()) -> <AsyncReadGraph,Proc> () Performs asynchronously a new Read request with given result and exception handlers. unaryQuery :: (a -> <ReadGraph,c> b) -> a -> <ReadGraph> b unaryQueryCached :: (a -> <ReadGraph,c> b) -> a -> <ReadGraph> b WritingAdding statementsnewResource :: () -> <WriteGraph> Resource Creates a new resource. claim :: Resource -> Resource -> Resource -> <WriteGraph> () Adds a statement to the semantic graph. claimWithInverse :: Resource -> Resource -> Maybe Resource -> Resource -> <WriteGraph> () deny :: Resource -> Resource -> Resource -> <WriteGraph> () Removes a statement with the given subject, predicate and object denyByPredicate :: Resource -> Resource -> <WriteGraph> () denyAllStatements :: Resource -> <WriteGraph> () claimAssertion :: Resource -> Resource -> Resource -> <WriteGraph> () Writing literalsclaimRelatedValue :: Serializable a => Resource -> Resource -> a -> <WriteGraph> () Sets the value of the literal that is an object with the given subject and predicate. claimRelatedValueWithType :: Serializable a => Resource -> Resource -> Resource -> a -> <WriteGraph> () untypedClaimRelatedValue :: Resource -> Resource -> a -> <WriteGraph> () denyValue :: Resource -> <WriteGraph> () Ordered setsaddToOrderedSet :: Resource -> Resource -> <WriteGraph> Boolean
addFirstToOrderedSet :: Resource -> Resource -> <WriteGraph> Boolean
addAfterToOrderedSet :: Resource -> Resource -> Resource -> <WriteGraph> Boolean
addBeforeToOrderedSet :: Resource -> Resource -> Resource -> <WriteGraph> Boolean
removeFromOrderedSet :: Resource -> Resource -> <WriteGraph> Boolean
setOrderedSet :: Resource -> [Resource] -> <WriteGraph> Boolean elementsOfOrderedSet :: Resource -> <ReadGraph> [Resource] parentOrderedSet :: Resource -> <ReadGraph> Resource Linked ListelementsOfList :: Resource -> <ReadGraph> [Resource]
createList :: [Resource] -> <WriteGraph> Resource
createListWithType :: Resource -> [Resource] -> <WriteGraph> Resource
insertListBack :: Resource -> [Resource] -> <WriteGraph> ()
insertListFront :: Resource -> [Resource] -> <WriteGraph> ()
removeListElement :: Resource -> Resource -> <WriteGraph> Boolean
swapListElementWithPrevious :: Resource -> Resource -> <WriteGraph> Boolean swapListElementWithNext :: Resource -> Resource -> <WriteGraph> Boolean TransactionssyncRead :: (() -> <Proc,ReadGraph> a) -> <Proc> a Executes a read transaction and waits that it completes. asyncRead :: (() -> <Proc,ReadGraph> a) -> <Proc> () Begins a read transaction and immediately returns. syncWrite :: (() -> <Proc,ReadGraph,WriteGraph> a) -> <Proc> a Executes a write transaction and waits that it completes. delayedSyncWrite :: (() -> <Proc,WriteGraph> a) -> <Proc> a Executes a delayed write transaction and waits that it completes. asyncWrite :: (() -> <Proc,ReadGraph,WriteGraph> a) -> <Proc> () Begins a write transaction and immediately returns. virtualSyncWriteMem :: String -> (() -> <b,WriteGraph> a) -> <b,WriteGraph> a virtualSyncWriteWS :: String -> (() -> <b,WriteGraph> a) -> <b,WriteGraph> a lift1Read :: (a -> <ReadGraph,Proc> b) -> a -> <Proc> b lift2Read :: (a -> b -> <ReadGraph,Proc> c) -> a -> b -> <Proc> c lift3Read :: (a -> b -> c -> <ReadGraph,Proc> d) -> a -> b -> c -> <Proc> d lift1Write :: (a -> <WriteGraph,Proc> b) -> a -> <Proc> b lift2Write :: (a -> b -> <WriteGraph,Proc> c) -> a -> b -> <Proc> c lift3Write :: (a -> b -> c -> <WriteGraph,Proc> d) -> a -> b -> c -> <Proc> d addCommentMetadata :: String -> <WriteGraph> () makeSynchronous :: Boolean -> <ReadGraph> () enableDependencies :: () -> <WriteGraph> () disableDependencies :: () -> <WriteGraph> () UndomarkUndoPoint :: () -> <WriteGraph> () startUndoPoint :: String -> <WriteGraph> () undo :: () -> <Proc> String redo :: () -> <Proc> String undoOperations :: Integer -> <Proc> String Generation of resource namesfindFreshName :: String -> Resource -> <ReadGraph> String findFreshEscapedName :: String -> Resource -> <ReadGraph> String Helper functions for handling URIsescapeURI :: String -> String unescapeURI :: String -> String splitURI :: String -> [String] Structured graph writingnewEntity :: [Resource -> <ReadGraph,WriteGraph> ()] -> <ReadGraph,WriteGraph> Resource hasStatement :: Resource -> Resource -> Resource -> <WriteGraph> () hasName :: String -> Resource -> <WriteGraph> () hasType :: Resource -> Resource -> <WriteGraph> () hasLabel :: String -> Resource -> <WriteGraph> () hasProperty :: Serializable a => Resource -> a -> Resource -> <WriteGraph> () hasTypedProperty :: Serializable a => Resource -> a -> Resource -> Resource -> <WriteGraph> () hasPossibleProperty :: Serializable a => Resource -> Maybe a -> Resource -> <WriteGraph> () hasParent :: Resource -> Resource -> <WriteGraph> () ClustersnewClusterSet :: Resource -> <WriteGraph> () selectClusterSet :: Resource -> <WriteGraph> () sortByCluster :: [a] -> (a -> Resource) -> <ReadGraph> [a] DebuggingqueryDebugSupport :: String -> <Proc> String queryListSupport :: String -> <Proc> String Domain/Namespace Migrationdata MigrationConfig
If
Defines whether the migration should collect data for performed and failed migrations in the collections included in this class. If the client only wants to know whether migration succeeded or failed somehow, this can be set to false by the constructor.
If MigrationConfig :: Boolean -> Boolean -> Boolean -> MigrationConfig data MigrationReport migrateDomainWithSpecs :: MigrationConfig -> Resource -> [(Resource, [Resource])] -> <WriteGraph> MigrationReport
Executes graph domain based migration for the specified The function produces a Migration specifications are provided as a list of
Multiple specifications can be provided to the function. The migration will process all database statements of the computed graph domain
for If a match is found in a target namespace, the statement containing the migrated resources will first be denied and then reclaimed using the migrated predicate and/or object. If no match can be found in any of the provided target namespaces, migration for that specific resource is considered failed and will be included in the produced MigrationReport according to what is specified in the provided MigrationConfig. migrateDomain :: MigrationConfig -> Resource -> Resource -> Resource -> <WriteGraph> MigrationReport
Equal to applyMigrationChanges :: MigrationReport -> <WriteGraph> () If dumpMigrationReport :: MigrationReport -> <ReadGraph> String dumpMigrationReport2 :: MigrationReport -> <ReadGraph> String Miscellaneous functionsGRAPH_HINT_SYNCHRONOUS :: String activateOnce :: Resource -> <Proc> () addMetadataListener :: ChangeListener -> <Proc> () assertedObjects_ :: Resource -> Resource -> <ReadGraph> Collection Resource assertedStatements_ :: Resource -> Resource -> <ReadGraph> Collection Statement claimRelatedValueWithType_ :: Resource -> Resource -> Resource -> a -> Binding a -> <WriteGraph> () claimRelatedValue_ :: Resource -> Resource -> a -> Binding a -> <WriteGraph> () collectionToList :: Collection a -> [a] copyTo :: Resource -> Resource -> <WriteGraph> Resource denyRelatedValue :: Resource -> Resource -> <WriteGraph> () emptyTrashBin :: () -> <Proc> () flushCluster :: () -> <WriteGraph> () getDataType :: Resource -> <ReadGraph> Datatype isImmutable :: Resource -> <ReadGraph> Boolean isPersistent :: Resource -> Boolean objects_ :: Resource -> Resource -> <ReadGraph> Collection Resource possibleFromDynamic :: Typeable a => String -> Dynamic -> Maybe a Tries to convert the given Dynamic value to a value with the inferred type possibleRelatedInteger :: Resource -> Resource -> <ReadGraph> Maybe Integer possibleRelatedString :: Resource -> Resource -> <ReadGraph> Maybe String possibleRelatedValue2 :: Resource -> Resource -> <ReadGraph> Maybe a possibleRelatedValue_ :: Resource -> Resource -> Binding a -> <ReadGraph> Maybe a possibleResourceChild :: Resource -> String -> <ReadGraph> Maybe Resource possibleStatement :: Resource -> Resource -> <ReadGraph> Maybe Statement prettyPrintResource :: Resource -> Boolean -> <ReadGraph> String printChanges :: Long -> Long -> <ReadGraph> String Simple change / metadata debugging report. purgeDatabase :: () -> <Proc> () removeMetadataListener :: ChangeListener -> <Proc> () resourceChildrenOf :: Resource -> <ReadGraph> [Resource] resourceToCollection :: a -> Collection a safeExec :: (() -> <Proc> a) -> <Proc> a setDependenciesIndexingDisabled :: Boolean -> <WriteGraph> () statements_ :: Resource -> Resource -> <ReadGraph> Collection Statement syncActivateOnce :: Resource -> <WriteGraph,Proc> () untypedClaimValue :: Resource -> a -> <WriteGraph> () untypedPossibleValueOf :: Resource -> <ReadGraph> Maybe Dynamic updateEntity :: Resource -> [Resource -> <ReadGraph,WriteGraph> ()] -> <ReadGraph,WriteGraph> Resource withGraphHintBoolean :: String -> Boolean -> (() -> <b,ReadGraph> a) -> <ReadGraph> a |