[not loaded]All predicatesShow sourcerdf_edit.pl -- RDF edit layer

This library provides a number of functions on top of the rdf_db module:

See also
- rdf_persistency.pl provides reliable persistency, but without changes boardcasting and undo/redo.
To be done
- This library must be rewritten using rdf_monitor/3. This allows using edit layer without having to choose between rdf_ and rdfe_ predicates.
Sourcerdfe_update(+Subject, +Predicate, +Object, +Action)
Update an existing triple. Possible actions are:

! subject(+Subject) ! predicate(+Predicate) ! object(+Object) ! source(+Source)

Sourcerdfe_delete(+Subject)
Delete a subject and all we know about it. This is a bit tricky. If we are involved in transitive relations, should we re-joint these in this module?
Sourcerdfe_load(+File) is det
Sourcerdfe_load(+File, +Options) is det
Load an RDF file and record this action including version information to facilitate reliable reload.
Sourceensure_snapshot(+Path)[private]
Ensure we have a snapshot of Path if we are making a journal, so we can always reload the snapshot to ensure exactly the same state.
Sourceload_snapshot(+Source, +Path)[private]
Load triples from the given snapshot file. One of the troubles is the time-stamp to avoid rdf_make/0 from reloading the file. for the time being we use 1e12, which is a lot further in the future than this system is going to live.
Sourcesnapshot_file(+Path, +MD5, +Access, -File)[private]
Find existing snapsnot file or location to save a new one.
Sourcerdfe_snapshot_file(-File)
Enumerate the MD5 snapshot files required to restore the current journal file. Using this call we can write a routine that packages the journal file with all required snapshots to restore the journal on another computer.
Sourcerdfe_register_ns(Id, URI)
Encapsulation of rdf_register_ns(Id, URI)
Sourcerdfe_transaction(:Goal)
Run Goal, recording all modifications as a single transaction. If Goal raises an exception or fails, all changes are rolled-back.
rdfe_begin_transaction[private]
Start a transaction. This is followed by either rdfe_end_transaction or rdfe_rollback. Transactions may be nested.
Sourcerollback(+TID)[private]
This is the same as undo/1, but it must not record the undone actions as rollbacks cannot be `redone'. Somehow there should be a cleaner way to distinguish between transactional operations and plain operations.
Sourceundo(+TID)[private]
Undo a transaction as well as possible transactions nested into it.
Sourcerdfe_undo
Undo a (toplevel) transaction. More calls do further undo. The `Undone' actions are re-added to the undo log, so the user can redo them. Fails if there are no more undo/redo transactions.
Sourcerdfe_redo
Start a redo-session
Sourcerdfe_can_redo(-TID) is semidet
Sourcerdfe_can_undo(-TID) is semidet
Check if we can undo and if so return the id of the transaction that will be un/re-done. A subsequent call to rdfe_transaction_name can be used to give a hint in the UI.
Sourcerdfe_transaction_name(+TID, -Name)
Return name if the transaction is named.
Sourcerdfe_set_transaction_name(+Name)
Set name of the current transaction
Sourcerdfe_transaction_member(+TID, -Action)
Query actions inside a transaction to allow for quick update of visualisers.
Sourcerdfe_set_file_property(+File, +Options)
Set properties on the file. Options is one of
  • access(ro/rw)
  • default(all/fallback)
Sourcerdfe_get_file_property(+FileOrURL, ?Option)
rdfe_get_file_property(-URL, ?Option)
Fetch file properties set with rdfe_set_file_property/2.
Sourcecheck_file_protection(-Error)[private]
Check modification of all protected files
Sourceto_uri(+Spec, -URL) is det[private]
Convert a specification into a URL.
Sourcerdfe_is_modified(?Source)
True if facts have been added, deleted or updated that have Source as `payload'.
Sourcerdfe_clear_modified(+Graph) is det
Consider the current state of Graph as unmodified.
Sourcerdfe_set_watermark(Name)
Create a watermark for undo and replay journal upto this point. The rest of the logic needs to be written later.
Sourcerdfe_reset
Clear database, undo, namespaces and journalling info.
Sourcerdfe_reset_journal[private]
If a journal is open, close it using rdfe_close_journal/0
Sourcerdfe_open_journal(+File, +Mode) is det
Open a journal writing to File in Mode. Mode is one of
read
Open and replay the journal
write
Delete current journal and create a fresh one
append
Read and replay the existing journal and append new modifications to the File.
Sourcerdfe_close_journal
Close the journal. Automatically called from at program termination from at_halt/1.
Sourcerdfe_current_journal(-Path)
Query the currently open journal
Sourcerdfe_replay_journal(+File)
Replay a journal file. For now this is our cheap way to deal with save/load. Future versions may be more clever when dealing with the version information stored in the journal.
Sourcereplay_action(+Action)[private]
Replay actions from the journal. Tricky is rdf_load/3. It should reload the file in the state it was in at the moment it was created. For now this has been hacked for files that were empry at the moment they where loaded (e.g. created from `new_file' in our GUI prototype). How to solve this? We could warn if the file appears changed, but this isn't really easy as copying and OS differences makes it hard to decide on changes by length as well as modification time. Alternatively we could save the state in seperate quick-load states.
Sourcemake_path(+File, +PWD, -Path)[private]
Return location of File relative to PWD, Parent of PWD, etc. (TBD)
Sourcerdfe_load(+File) is det
Sourcerdfe_load(+File, +Options) is det
Load an RDF file and record this action including version information to facilitate reliable reload.
Sourcerdfe_can_redo(-TID) is semidet
Sourcerdfe_can_undo(-TID) is semidet
Check if we can undo and if so return the id of the transaction that will be un/re-done. A subsequent call to rdfe_transaction_name can be used to give a hint in the UI.

Undocumented predicates

The following predicates are exported, but not or incorrectly documented.

Sourcerdfe_assert(Arg1, Arg2, Arg3)
Sourcerdfe_assert(Arg1, Arg2, Arg3, Arg4)
Sourcerdfe_retractall(Arg1, Arg2, Arg3)
Sourcerdfe_retractall(Arg1, Arg2, Arg3, Arg4)
Sourcerdfe_update(Arg1, Arg2, Arg3, Arg4, Arg5)
Sourcerdfe_unregister_ns(Arg1, Arg2)
Sourcerdfe_transaction(Arg1, Arg2)