diff --git a/.cbindgen.toml b/.cbindgen.toml new file mode 100644 index 000000000..313f9b3b2 --- /dev/null +++ b/.cbindgen.toml @@ -0,0 +1,162 @@ +# This is a template cbindgen.toml file with all of the default values. +# Some values are commented out because their absence is the real default. +# +# See https://github.com/mozilla/cbindgen/blob/master/docs.md#cbindgentoml +# for detailed documentation of every option here. + + + +language = "C" + + + +############## Options for Wrapping the Contents of the Header ################# + +#header = "/* Text to put at the beginning of the generated file. Probably a license. */" +# trailer = "/* Text to put at the end of the generated file */" +# include_guard = "my_bindings_h" +# pragma_once = true +# autogen_warning = "/* Warning, this file is autogenerated by cbindgen. Don't modify this manually. */" +pragma_once = true +autogen_warning = "/* Warning, this file is autogenerated by cbindgen. Don't modify this manually. */" +include_version = true +package_version = true +# namespace = "my_namespace" +namespaces = [] +using_namespaces = [] +#sys_includes = ["stdarg.h", "stdbool.h", "stddef.h", "stdint.h", "stdlib.h"] +includes = [] +no_includes = true +cpp_compat = true +after_includes = "" + + + + +############################ Code Style Options ################################ + +braces = "SameLine" +line_length = 100 +tab_width = 2 +documentation = true +documentation_style = "auto" +documentation_length = "full" +line_endings = "LF" # also "CR", "CRLF", "Native" + + + + +############################# Codegen Options ################################## + +style = "both" +sort_by = "Name" # default for `fn.sort_by` and `const.sort_by` +usize_is_size_t = true + + + +[defines] +# "target_os = freebsd" = "DEFINE_FREEBSD" +# "feature = serde" = "DEFINE_SERDE" + + + +[export] +include = [] +exclude = ["BTERM", "DELIMITER", "LTERM", "NEGATIVE_SIGN", "TERM"] # Exclude the definitions from the generated file +prefix = "SCRYER_" +item_types = [] +renaming_overrides_prefixing = false + + + +[export.rename] + + + +[export.body] + + +[export.mangle] + + +[fn] +rename_args = "None" +# must_use = "MUST_USE_FUNC" +# deprecated = "DEPRECATED_FUNC" +# deprecated_with_note = "DEPRECATED_FUNC_WITH_NOTE" +# no_return = "NO_RETURN" +# prefix = "START_FUNC" +# postfix = "END_FUNC" +args = "auto" +sort_by = "Name" + + + + +[struct] +rename_fields = "None" +# must_use = "MUST_USE_STRUCT" +# deprecated = "DEPRECATED_STRUCT" +# deprecated_with_note = "DEPRECATED_STRUCT_WITH_NOTE" +derive_constructor = false +derive_eq = false +derive_neq = false +derive_lt = false +derive_lte = false +derive_gt = false +derive_gte = false + + + + +[enum] +rename_variants = "None" +# must_use = "MUST_USE_ENUM" +# deprecated = "DEPRECATED_ENUM" +# deprecated_with_note = "DEPRECATED_ENUM_WITH_NOTE" +add_sentinel = false +prefix_with_name = false +derive_helper_methods = false +derive_const_casts = false +derive_mut_casts = false +# cast_assert_name = "ASSERT" +derive_tagged_enum_destructor = false +derive_tagged_enum_copy_constructor = false +enum_class = true +private_default_tagged_enum_constructor = false + + + + +[const] +allow_static_const = true +allow_constexpr = false +sort_by = "Name" + + + + +[macro_expansion] +bitflags = false + + + + + + +############## Options for How Your Rust library Should Be Parsed ############## + +[parse] +parse_deps = false +include = ["src/lib/machine/lib.rs"] +exclude = [] +clean = false +extra_bindings = [] + + + +[parse.expand] +crates = [] +all_features = false +default_features = true +features = [] \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index 0fc692cdd..9a35912d4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -287,6 +287,24 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" +[[package]] +name = "cbindgen" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fce8dd7fcfcbf3a0a87d8f515194b49d6135acab73e18bd380d1d93bb1a15eb" +dependencies = [ + "heck 0.4.1", + "indexmap", + "log", + "proc-macro2", + "quote", + "serde", + "serde_json", + "syn 2.0.72", + "tempfile", + "toml", +] + [[package]] name = "cc" version = "1.1.7" @@ -631,6 +649,7 @@ dependencies = [ "dashu-int", "num-modular", "num-order", + "num-traits", "rustversion", "static_assertions", ] @@ -645,6 +664,7 @@ dependencies = [ "dashu-base", "num-modular", "num-order", + "num-traits", "rustversion", "static_assertions", ] @@ -676,6 +696,7 @@ dependencies = [ "dashu-int", "num-modular", "num-order", + "num-traits", "rustversion", ] @@ -1126,6 +1147,12 @@ dependencies = [ "http 0.2.12", ] +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + [[package]] name = "heck" version = "0.5.0" @@ -2548,6 +2575,7 @@ dependencies = [ "bitvec", "blake2", "bytes", + "cbindgen", "chrono", "console_error_panic_hook", "cpu-time", @@ -2576,6 +2604,7 @@ dependencies = [ "maplit", "native-tls", "num-order", + "num-traits", "ordered-float", "phf 0.11.2", "pprof", @@ -2963,7 +2992,7 @@ version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" dependencies = [ - "heck", + "heck 0.5.0", "proc-macro2", "quote", "rustversion", @@ -3225,6 +3254,18 @@ dependencies = [ "tokio", ] +[[package]] +name = "toml" +version = "0.8.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + [[package]] name = "toml_datetime" version = "0.6.8" @@ -3477,19 +3518,20 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" +checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" dependencies = [ "cfg-if", + "once_cell", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" +checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" dependencies = [ "bumpalo", "log", @@ -3514,9 +3556,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" +checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -3524,9 +3566,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" +checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" dependencies = [ "proc-macro2", "quote", @@ -3537,9 +3579,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" +checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" [[package]] name = "web-sys" diff --git a/Cargo.toml b/Cargo.toml index 0ba4e9aa9..01ceb79c7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -35,6 +35,7 @@ syn = { version = "2.0.72", features = ['full', 'visit', 'extra-traits'] } to-syn-value = "0.1.1" to-syn-value_derive = "0.1.1" walkdir = "2" +cbindgen = { version = "0.27.0", default-features = false } [dependencies] arcu = { version = "0.1.1", features = ["thread_local_counter"] } @@ -46,7 +47,7 @@ bytes = "1" chrono = "0.4.38" cpu-time = "1.0.0" crrl = "0.9.0" -dashu = "0.4.2" +dashu = { version = "0.4.2", features = ["num-traits"] } derive_more = "0.99.18" dirs-next = "2.0.0" divrem = "1.0.0" @@ -71,6 +72,7 @@ ryu = "1.0.18" sha3 = "0.10.8" smallvec = "1.13.2" static_assertions = "1.1.0" +num-traits = "0.2.19" scraper = { version = "0.19.1", default-features = false, features = [ "errors", @@ -79,7 +81,7 @@ ego-tree = "0.6.2" serde_json = "1.0.122" -serde = "1.0.204" +serde = { version="1.0.204", features = ["derive"] } [target.'cfg(not(target_arch = "wasm32"))'.dependencies] crossterm = { version = "0.28.1", optional = true } diff --git a/build/main.rs b/build/main.rs index a43b9e865..2d83686a9 100644 --- a/build/main.rs +++ b/build/main.rs @@ -52,6 +52,8 @@ fn main() { println!("Failed to run rustfmt, will skip formatting generated files.") } + generate_c_bindings(); + let out_dir = env::var("OUT_DIR").unwrap(); let dest_path = Path::new(&out_dir).join("libraries.rs"); @@ -120,6 +122,27 @@ fn main() { println!("cargo:rerun-if-changed=src/"); } +fn generate_c_bindings() { + println!("cargo:rerun-if-changed=.cbindgen.toml"); + let manifest_dir = std::env::var("CARGO_MANIFEST_DIR").unwrap(); + let headers_dir = Path::new(&manifest_dir).join("docs/shared_library/libscryer_prolog.h"); + let config = + cbindgen::Config::from_file(".cbindgen.toml").unwrap_or(cbindgen::Config::default()); + + match cbindgen::Builder::new() + .with_crate(manifest_dir) + .with_config(config) + .generate() + { + Ok(bindings) => { + bindings.write_to_file(headers_dir); + } + Err(err) => { + println!("cargo:warning=Failed to generate C bindings: {err}"); + } + } +} + fn format_generated_file(path: &Path) { Command::new("rustfmt") .arg(path.as_os_str()) diff --git a/docs/shared_library/README.md b/docs/shared_library/README.md new file mode 100644 index 000000000..98010be13 --- /dev/null +++ b/docs/shared_library/README.md @@ -0,0 +1,234 @@ +### Using Scryer Prolog as a Shared Library + +Think of a shared library like a toolbox filled with pre-built tools (functions) that other programs can use without needing to rebuild everything from scratch. In our case, `libscryer_prolog.XXX` is the toolbox containing Scryer Prolog's powerful logic engine. + +If you are familiar with using shared libraries, [`docs/shared_library/libscryer_prolog.h`](./libscryer_prolog.h) file is automatically generated from the latest bindings, please use it as a reference to implement the bindings in the language of your choice. + +**Note:** Many of the code examples here will be in Python. This is not an endorsement of a particular language, but used for clarity and accessibility, and due to the shared library author's familiarity. + +See [Scryer Prolog online documentation](https://docs.rs/scryer-prolog/latest/scryer_prolog/) for summary of available functions. + +**Steps to Use the Shared Library:** + +1. **Locate the Library:** After building Scryer Prolog, you'll find the shared library in: + + `/scryer-prolog/target/release`. + + Replace `` with the actual path where you installed Scryer Prolog on your computer. The library will have a name like `libscryer_prolog.so` (Linux), `libscryer_prolog.dylib` (macOS), or `scryer_prolog.dll` (Windows). + +2. **Load the Library:** Here are basic examples for common languages: + + * **C/C++ (Linux/macOS):** + ```c++ + #include + + void* handle = dlopen("libscryer_prolog.so", RTLD_LAZY); // Load the library + if (!handle) { + // Handle error: library not found + } + + // ... Get function pointers from the loaded library ... + ``` + + * **Python:** You'll typically use libraries like `ctypes`: + ```python + import ctypes + + lib = ctypes.cdll("./libscryer_prolog.so") # Replace with correct path + + # ... Access functions in lib ... + ``` +3. **Access Functions:** Once the library is loaded, you can call its functions (like `scryer_consult_module_string`, `scryer_run_query`) just like you would any other function in your code. See the Python reference implementation below. + + + **Important Notes:** + +* **Memory Management:** Be extra careful about memory management when interacting with C libraries from other languages (especially strings). See below. + + +The following functions are exposed: + +**Shared Library Memory Management Considerations and Usage Overview** + + +* **Ownership Transfer:** + + The Rust library uses C-style strings (`CString`) to return data. To avoid premature cleanup by Rust's garbage collector, ownership of the string pointer is transferred to the client application. This means the client becomes responsible for freeing the memory using `scryer_free_c_string`. Failure to do so will cause memory leaks. + + +**Using the Library: A Step-by-Step Guide** + +1. **Initialization (`scryer_machine_new`):** Before using any other function, initialize the Prolog machine using `scryer_machine_new`. This creates a pointer that must be tracked by the client and later released with `scryer_machine_free`. + +2. **Loading Data:** You have two options for loading Prolog data: + * **Direct Consultation:** Use `scryer_consult_module_string` to load and immediately run Prolog source code from a C string. Think of it as directly providing the source code to Scryer Prolog. + * **Query Generation:** + + - Start a new query generator using `scryer_start_new_query_generator`, passing your machine pointer from step 1 and a prolog query as input (do not include the `?-` functor). + - Use `scryer_run_query_generator` repeatedly until it returns `{ "status": "ok", "result": }`. This indicates that all results have been generated. To be clear, if the first "result" is True, all results will continue to be True. Once a result returns False, all further results will continue to be False. + +3. **Running Queries:** + + * For non-generative queries (those with finite results), use `scryer_run_query`. + * For potentially infinite result sets, utilize the query generator approach described above. + +4. **Cleanup:** + + * Always call `scryer_cleanup_query_generator` after finishing with a query generator to release associated resources (unless it's done internally for you). + * Call `scryer_machine_free` once you are done using the Prolog machine, regardless of the loading and querying methods used. + +5. **Important Caveats and Known Limitations:** + + * The JSON code returned by `scryer_run_query` and `scryer_run_query_generator` returns a Web API-style response, which is NOT in keeping with the general spirit of Prolog to return _goals_ (which would be valid inputs to those same functions). Future APIs will return valid Scryer Prolog goals. + * The results yielded by `scryer_cleanup_query_generator` do not have _determinism_, meaning, the results are exhausted when the first `boolean` result appears. This will be addressed in future enhancements. + * Residual goals are **not** expressed correctly by this API, these APIs can only express concrete (equality) goals. The improved APIs in a future release will address this point. + * A single machine instance can only run a single generative query a time. This is not normally a concern in normal Scryer Prolog operation, but when used as a library, there could be a temptation to generate multiple streams from the same machine, however, this is undefined behavior -- it could cause a panic or incorrect results: + +```python +if __name__ == '__main__': + with ScryerMachine(""" + :- use_module(library(dcgs)). + :- use_module(library(lists)). + :- use_module(library(clpz)). + + as --> []. + as --> [a], as. + + fact(0). + fact(1). + fact(2). + """) as wam: + for n, b in zip(range(10), wam.lazy_eval('phrase(bs, Bs).')): + for i, a in zip(range(10), wam.lazy_eval('fact(Fact).')): + print(n, i, a, b) + +## Expected +# Panic -- bs is not defined. + +## Actual +# 0 0 {'Fact': 0} {'Bs': ['']} +# 0 1 {'Fact': 1} {'Bs': ['']} +# 0 2 {'Fact': 2} {'Bs': ['']} + +``` + +a better approach, for now, would be to use distinct machines for multiple generative streams: + +```python +if __name__ == '__main__': + source = """ + :- use_module(library(dcgs)). + :- use_module(library(lists)). + :- use_module(library(clpz)). + + as --> []. + as --> [a], as. + + fact(0). + fact(1). + fact(2). + """ + + with ScryerMachine(source) as wam: + with ScryerMachine(source) as wam1: + for n, a in zip(range(3), wam.lazy_eval('phrase(as, As).')): + for i, fact in zip(range(3), wam1.lazy_eval('fact(Fact).')): + print(n, i, fact, a) + +# 0 0 {'Fact': 0} {'As': ['']} +# 0 1 {'Fact': 1} {'As': ['']} +# 0 2 {'Fact': 2} {'As': ['']} +# 1 0 {'Fact': 0} {'As': 'a'} +# 1 1 {'Fact': 1} {'As': 'a'} +# 1 2 {'Fact': 2} {'As': 'a'} +# 2 0 {'Fact': 0} {'As': 'aa'} +# 2 1 {'Fact': 1} {'As': 'aa'} +# 2 2 {'Fact': 2} {'As': 'aa'} + +``` + + * Besides being limited to a single generative stream at a time, when the generative stream is finished or not longer needed, the resources used MUST be manually deallocated with `scryer_cleanup_query_generator`, or it will leave the Prolog machine in an indeteriminate state and future answers will not be accurate (if it doesn't cause a kernel panic). I advise you to treat a both scryer machines and generative queries the same way you would treat a file or other resource, and wrap it with a try/finally or other form of context manager, e.g.: + +```python +# ... snip ... +class ScryerMachine: + + def __init__(self, source=None): + self.source = source + self.m: MACHINE_PTR = None + + def __enter__(self, query: str = None): + self.m = lib.scryer_machine_new() # initiate and store machine pointer + if self.source: + load_facts(self.m, self.source) + if query: + return self.lazy_eval(self.m, query) + return self + + def __exit__(self, *_): + lib.scryer_machine_free(self.m) # deallocate resources when lexical scope ends + +# ... snip ... +``` + +```python +# ...snip... + +@contextlib.contextmanager +def query_generator(machine: MACHINE_PTR, query: str): + qs: QUERY_STATE_PTR = lib.scryer_start_new_query_generator(machine, query.encode('utf-8')) + try: + def generator(): + seen_answer = False + while True: + answer = run_generator_step(machine, qs) + if not isinstance(answer, list): + if seen_answer: + break + yield answer[0] if isinstance(answer, list) else answer + break + seen_answer = True + yield answer[0] if isinstance(answer, list) else answer + + yield generator() + finally: + handle_loader_deloader(lib.scryer_cleanup_query_generator(machine, qs)) +# ...snip... +``` + +See [`scryer_python.py`](scryer_python.py) for a complete example. + + * Note that the JSON printer returns results that are not completely accurate when it comes to differentiating strings from symbols, e.g.: + +**Correct** +```prolog + + + ?- member(X, [a,"a",f(a),"f(a)",Y,"Y"]) ; dif(X,a), dif(Y,X). + X = a + ; X = "a" + ; X = f(a) + ; X = "f(a)" % these are correct + ; X = Y + ; X = "Y" + ; dif:dif(X,a), dif:dif(Y,X). +``` + +**Incorrect** +```python +if __name__ == '__main__': + with ScryerMachine(":- use_module(library(dif)). " + ":- use_module(library(lists)).") as wam: + for goal in wam.lazy_eval('member(X, [a,"a",f(a),"f(a)",Y,"Y"]) ; dif(X,a), dif(Y,X).'): + print(goal) + ## INCORRECT + # {'X': 'a'} + # {'X': 'a'} + # {'X': 'f(a)'} + # {'X': 'f(a)'} + # {'Y': 'X'} + # {'X': 'Y'} + # {'X': '_150', 'Y': '_180'} +``` + +This discrepancy will be addressed in future API releases. diff --git a/docs/shared_library/libscryer_prolog.h b/docs/shared_library/libscryer_prolog.h new file mode 100644 index 000000000..7c634b5c8 --- /dev/null +++ b/docs/shared_library/libscryer_prolog.h @@ -0,0 +1,181 @@ +/* Package version: 0.9.4 */ + +#pragma once + +/* Generated with cbindgen:0.27.0 */ + +/* Warning, this file is autogenerated by cbindgen. Don't modify this manually. */ + + + +#define SCRYER_MAX_ARITY 1023 + +typedef struct SCRYER_Machine SCRYER_Machine; + +typedef struct SCRYER_QueryState SCRYER_QueryState; + +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus + +/** + * Consults a Scryer Prolog module from a string, optionally with a given module name. + * Will panic if provided invalid Scryer Prolog code. + * + * # Safety + * + * * `machine` must be a valid mutable pointer to a [`Machine`] created by + * [`machine_new`] that has not yet been freed. + * * `input` must be a valid pointer to a null terminated UTF-8 string of valid + * Scryer Prolog code that satisfies the safety requirements of [`CStr::from_ptr`]. + * * `module_name`, must be a valid pointer to a null terminated UTF-8 string + * of a valid Prolog module name that satisfies the safety requirements of + * [`CStr::from_ptr`]. + * * there must be no [`QueryState`] for this [`Machine`] that has been created by + * [`run_query_iter`] that has not yet been freed by + * [`query_state_free`], or the [`Machine`] will enter an undefined state + * with unpredictable behavior. + * + * # Arguments + * + * * `machine` - A mutable reference to the [`Machine`] to load the module into. + * * `module_name` - A pointer to a null-terminated UTF-8 string representing + * Scryer Prolog module name. + * * `input` - A pointer to a null-terminated UTF-8 string representing Scryer Prolog code. + * + */ +void scryer_consult_module_string(struct SCRYER_Machine *machine, + const char *module_name, + const char *input); + +/** + * Deallocate a Scryer Prolog string. + * + * # Safety + * + * * it is the caller's responsibility to ensure the `ptr` is not deallocated more than + * once. + */ +void scryer_free_c_string(char *ptr); + +/** + * Frees the memory occupied by a [`Machine`] object. + * + * # Safety + * + * * It is the caller's responsibility to ensure that the input is a valid [`Machine`] pointer + * created by [`machine_new`] that has not yet been freed by this function. + * * Any [`QueryState`] instances associated with this machine should be deallocated prior + * to calling this function on the input, otherwise those [`QueryState`] instances may + * not be deallocated until the program terminates. + * + */ +void scryer_machine_free(struct SCRYER_Machine *ptr); + +/** + * Create a new instance of the Scryer Machine. + * + * + * It is the caller's responsibility to maintain a reference to the machine pointer + * created by this function, passing it to [`machine_free`] to deallocate + * resources. Failure to do so may lead to memory leaks. + * + */ +struct SCRYER_Machine *scryer_machine_new(void); + +/** + * Cleans up the [`QueryState`] in the associated Scryer [`Machine`]. + * + * # Safety + * + * * `query_state` must be a valid mutable pointer to a [`QueryState`] created by [`run_query_iter`] + * that has not yet been freed by [`query_state_free`]. + * * There can be only one [`QueryState`] per [`Machine`] started by + * [`run_query_iter`] that has not yet been freed with + * [`query_state_free`] or the [`Machine`] state will enter an undefined + * configuration with unpredictable results. + */ +void scryer_query_state_free(struct SCRYER_QueryState *query_state); + +/** + * Greedily evaluate a prolog query, returning all results in a JSON-formatted string. + * Errors are printed to stderr and a null pointer is returned. + * + * # Safety + * + * * `machine` must be a valid [`Machine`] pointer created with [`machine_new`] + * that has not yet been freed. + * * There must be no existing [`QueryState`] for this [`Machine`] started by + * [`run_query_iter`] that has not yet been freed with + * [`query_state_free`] or the [`Machine`] state will enter an undefined + * configuration with unpredictable results. + * * it is the responsibility of the caller to deallocate the pointer returned by + * this function with [`scyer_free_c_string`] in order to avoid memory leaks. + * + * + * # Returns + * - Returns a pointer to a JSON formatted, null terminated UTF-8 string + * + * # Response Format + * ```json + * // if result is a binding + * + * // current limitation is that only concrete (equality) bindings are returned, + * // residual goals not yet supported. + * { + * "status": "ok", + * "result": [{ ... }], + * } + * + * // if result is a boolean goal + * + * { + * "status": "ok", + * "result": boolean + * } + */ +char *scryer_run_query(struct SCRYER_Machine *machine, const char *input); + +/** + * Returns a new query generator for the given virtual machine. Null pointer returned + * if string is not valid UTF-8. + * + * # Safety + * + * Caller must satisfy the following preconditions for this function: + * + * * Valid [`Machine`] pointer created with [`machine_new`] that has not yet been freed. + * * the input fulfill the safety requirements of [`CStr::from_ptr`]. + * * There must be no other [`QueryState`] for this [`Machine`] started by + * [`run_query_iter`] that has not yet been freed with + * [`query_state_free`] or the [`Machine`] state will enter an undefined + * configuration with unpredictable results. + * + * Other concerns: + * * after invoking this function, calling any other function besides [`run_query_next`] + * before invoking [`query_state_free`] on the [`QueryState`] pointer + * will leave the [`Machine`] in an undefined state + * + */ +struct SCRYER_QueryState *scryer_run_query_iter(struct SCRYER_Machine *machine, const char *input); + +/** + * Returns a NULL POINTER if no addition iterations, else returns a + * UTF-8 encoded JSON string with one iteration of results from a Scryer Prolog query. + * + * See documentation for known limitations (e.g., concrete goals only). + * + * # Safety + * + * * `query_state` must be a valid mutable pointer to a [`QueryState`] created by [`run_query_iter`] + * that has not yet been freed by [`query_state_free`]. + * * There can be only one [`QueryState`] per [`Machine`] started by + * [`run_query_iter`] that has not yet been freed with + * [`query_state_free`] or the [`Machine`] state will enter an undefined + * configuration with unpredictable results. + */ +char *scryer_run_query_next(struct SCRYER_QueryState *query_state); + +#ifdef __cplusplus +} // extern "C" +#endif // __cplusplus diff --git a/docs/shared_library/scryer_python.py b/docs/shared_library/scryer_python.py new file mode 100644 index 000000000..30c5a924a --- /dev/null +++ b/docs/shared_library/scryer_python.py @@ -0,0 +1,426 @@ +import contextlib +import ctypes +import json +import os +import platform +from typing import TypedDict, Union, List, Literal, Dict, ContextManager, Generator + + +####################### +## Type Declarations ## +####################### + +# Not necessary in Python, but to assist with +# readability and intent of functions + +class OkListResult(TypedDict): + status: Literal["ok"] + result: List[Dict[str, str]] + + +class OkBoolResult(TypedDict): + status: Literal["ok"] + result: bool + + +class ErrorResult(TypedDict): + status: Literal["error"] + error: str + + +class PanicResult(TypedDict): + status: Literal["panic"] + error: Literal["panic"] + + +SCRYER_QUERY_RESULT = Union[OkListResult, OkBoolResult, ErrorResult, PanicResult] + +# wherever you installed Scryer Prolog. +# if you are just hacking, feel free to replace this with +# hard coded path to your installation location +install_location = os.getenv("SCRYER_HOME") + +if platform.system() == 'Linux': + shared_library_name = 'libscryer_prolog.so' +elif platform.system() == 'Windows': + shared_library_name = 'scryer_prolog.dll' +elif platform.system() == 'Darwin': + shared_library_name = 'libscryer_prolog.dylib' +else: + raise RuntimeError("""Unsupported operating system, maybe! If + you know what you are doing, comment this out and put the name of the shared library here + and modify the `shared_library_path` below as required!""") + +# replace 'release' with 'debug' if you are developing the bindings +# compile the code with `cargo build --lib` for 'debug' +# compile the code with `cargo build --release` for speed in production. +shared_library_path = os.path.join(install_location, 'target', 'debug', shared_library_name) + +######################## +## LOW LEVEL BINDINGS ## +######################## + +# How to allocate shared library in python and assign correct types to the functions, +# adapt for your language of choice. Please refer to the scryer prolog documentation +# and corresponding C header for more information. +# +# Please see the higher level abstractions below for intended use. These are +# not intended for general use because it's quite inconvenient to serialize to bytes, +# deserialize, check for null pointers, etc. There's also significant risk of resource leaks +# and extra bookkeeping that would be required. +# +# Note: the wrapper functions over the low level DLL are not strictly necessary but +# help with autocompletion. + +lib = ctypes.cdll.LoadLibrary(shared_library_path) + +QUERY_STATE_PTR = MACHINE_PTR = ctypes.POINTER(ctypes.c_void_p) +UTF8_BYTES = ctypes.c_char_p +SCRYER_UTF8_PTR = ctypes.POINTER(ctypes.c_char) +INT32 = ctypes.c_int32 + +lib.scryer_run_query.argtypes = [MACHINE_PTR, UTF8_BYTES] +lib.scryer_run_query.restype = SCRYER_UTF8_PTR + + +def scryer_run_query(machine_ptr: MACHINE_PTR, utf8_bytes: bytes) -> SCRYER_UTF8_PTR: + return lib.scryer_run_query(machine_ptr, utf8_bytes) + + +lib.scryer_free_c_string.argtypes = [SCRYER_UTF8_PTR] +lib.scryer_free_c_string.restype = None + + +def scryer_free_c_string(utf8_ptr: UTF8_BYTES): + return lib.scryer_free_c_string(utf8_ptr) + + +lib.scryer_machine_new.argtypes = [] +lib.scryer_machine_new.restype = MACHINE_PTR + + +def scryer_machine_new(): + return lib.scryer_machine_new() + + +lib.scryer_machine_free.argtypes = [MACHINE_PTR] +lib.scryer_machine_free.restype = None + + +def scryer_machine_free(machine_ptr: MACHINE_PTR) -> SCRYER_UTF8_PTR: + return lib.scryer_machine_free(machine_ptr) + + +lib.scryer_consult_module_string.argtypes = [MACHINE_PTR, UTF8_BYTES, UTF8_BYTES] +lib.scryer_consult_module_string.restype = INT32 + + +def scryer_consult_module_string(machine_ptr: MACHINE_PTR, module_name: bytes, facts: bytes): + return lib.scryer_consult_module_string(machine_ptr, module_name, facts) + + +lib.scryer_run_query_iter.argtypes = [MACHINE_PTR, UTF8_BYTES] +lib.scryer_run_query_iter.restype = QUERY_STATE_PTR + + +def scryer_run_query_iter(machine_ptr: MACHINE_PTR, query: bytes) -> QUERY_STATE_PTR: + return lib.scryer_run_query_iter(machine_ptr, query) + + +lib.scryer_query_state_free.argtypes = [QUERY_STATE_PTR] +lib.scryer_query_state_free.restype = INT32 + + +def scryer_query_state_free(query_state_ptr: QUERY_STATE_PTR): + return lib.scryer_query_state_free(query_state_ptr) + + +lib.scryer_run_query_next.argtypes = [QUERY_STATE_PTR] +lib.scryer_run_query_next.restype = SCRYER_UTF8_PTR + + +def scryer_run_query_next(query_state_ptr: QUERY_STATE_PTR) -> SCRYER_UTF8_PTR: + return lib.scryer_run_query_next(query_state_ptr) + + +###################### +## HELPER FUNCTIONS ## +###################### + +# If programming in a purely functional style, the following functions would be sufficient. +# However, using these functions alone would be very prone to resource leaks and confusion +# from leaky abstractions that arise from the fact that Scryer Prolog (like most Prologs) +# was not designed to be used as a shared library in procedural languages. +# +# You would need to understand that the underlying VM (the Warren Abstract Machine) is only +# configured to be in one "mode" at a time. If it is currently serving a lazy query, +# it cannot do any other actions until it deallocates the resources for that query +# and returns to standby mode. As such, you would need to track the pointer for +# the query state that would be used to deallocate the lazy query mode. +# +# The `query_generator` context manager cleans up resources automatically +# but does not ensure that multiple queries are not running simultaneously. + + +class ScryerPanicException(RuntimeError): + pass + + +class ScryerError(Exception): + pass + + +def handle_scryer_result(result: str) -> SCRYER_QUERY_RESULT: + result = json.loads(result) + if result["status"] == "ok": + return result["result"] if 'result' in result else True + elif result["status"] == "error": + raise ScryerError(result["error"]) + elif result["status"] == "panic": + raise ScryerPanicException() + + +def eval_and_free(machine: MACHINE_PTR, query: str) -> SCRYER_QUERY_RESULT: + res_ptr = scryer_run_query(machine, query.encode('utf-8')) + res = ctypes.cast(res_ptr, UTF8_BYTES).value.decode('utf-8') + scryer_free_c_string(res_ptr) + return handle_scryer_result(res) + + +def run_generator_step(qs: QUERY_STATE_PTR) -> SCRYER_QUERY_RESULT | None: + res_ptr = scryer_run_query_next(qs) + if not res_ptr or res_ptr.contents is None: + return None + res = ctypes.cast(res_ptr, UTF8_BYTES).value.decode('utf-8') + scryer_free_c_string(res_ptr) + return handle_scryer_result(res) + + +def handle_loader_deloader(ret_val: INT32, message: str = None): + """ + Deal with functions which have no return value, such as resource deallocators. This will + throw an error if there was an error. + + :param ret_val: A pointer to a memory location + :return: The result of handling the Scryer result + """ + if ret_val == 1: + raise ScryerError(message) if message else ScryerError() + + +@contextlib.contextmanager +def query_generator(machine: MACHINE_PTR, query: str) -> ContextManager[Generator[SCRYER_QUERY_RESULT, None, None]]: + """ + Generates a query generator for a given machine and query. + + :param machine: A pointer to the machine. + :param query: The query string. + :return: A generator that yields the results of running the generator step. + """ + qs: QUERY_STATE_PTR = scryer_run_query_iter(machine, query.encode('utf-8')) + deloaded = False + try: + def g(): + nonlocal deloaded + while True: + answer = run_generator_step(qs) + if answer is None: + handle_loader_deloader(scryer_query_state_free(qs)) + deloaded = True + break + yield answer[0] if isinstance(answer, list) else answer + + yield g() + finally: + if deloaded is False: + handle_loader_deloader(scryer_query_state_free(qs)) + + +def consult(machine: MACHINE_PTR, facts: str, module_name: str = None): + """ + Consults the given facts in the specified machine. Effectively the same as `load_facts()`. + + :param module_name: name of module to install facts, optional + :param machine: Pointer to the machine object. + :type machine: MACHINE_PTR + :param facts: The facts to be consulted. + :type facts: str + :return: The result of consulting the facts. + """ + if module_name and isinstance(module_name, str): + facts, module_name = module_name, facts + else: + module_name = 'facts' + handle_loader_deloader(scryer_consult_module_string(machine, module_name.encode('UTF-8'), facts.encode('utf-8'))) + + +#################### +## SCRYER MACHINE ## +#################### + +## This is a suggested high level API that prevents most footguns as long as you stay within the context manager API. +## see examples below for intended usage and example queries. +## For more information on using Scryer Prolog, check out https://www.metalevel.at/prolog and +## https://www.youtube.com/@ThePowerOfProlog +class ScryerMachine: + class IllegalWAMStateError(RuntimeError): + pass + + def __init__(self, source=None): + """ + Constructor for the class. + + :param source: The source of the object. + :type source: Any, optional + """ + self.source = source + self.m: MACHINE_PTR = None + self.query_in_progress = False + + def __enter__(self, query: str = None): + """ + Enter method for context manager. + + :param query: Optional query string to be evaluated. + :return: If query is provided, return the lazy evaluation of the query using the scryer machine. + Otherwise, return self. + """ + self.m = scryer_machine_new() + if self.source: + self.consult(self.source) + if query: + return self.lazy_eval_context(query) + return self + + def __exit__(self, *_): + """ + :param _: any additional arguments passed to the method (not used) + :return: None + + The method is responsible for freeing the resources held by the Scryer machine, indicated by the `self.m` attribute. + + Example usage: + with ScryerMachine(source_code) as wam: + for fact in wam.lazy_eval(some_query): + print(fact) + + """ + scryer_machine_free(self.m) + + def lazy_eval_context(self, query: str) -> ContextManager[Generator[SCRYER_QUERY_RESULT, None, None]]: + """ + Context manager yielding generator function that lazily evaluates the given query. + + :param query: The query string used to generate the answers. + :type query: str + :return: A context manager yielding a generator that yields the answers. + """ + self._valid_query_state_check() + self.query_in_progress = True + try: + return query_generator(self.m, query) + finally: + self.query_in_progress = False + + def _valid_query_state_check(self): + if self.query_in_progress is True: + raise ScryerMachine.IllegalWAMStateError( + "Query already running, must finish this query before starting a new one!" + ) + + def consult(self, facts: str): + """ + Consults the given facts and loads them into the 'm' object. + + :param facts: A list of facts to consult. Each fact should be a string. + :type facts: list[str] + :return: None + """ + self._valid_query_state_check() + consult(self.m, facts) + + def eval(self, query: str): + """ + Greedily evaluates the given query. NOTE: will cause threadlock on infinite query. + + :param query: The query string used to generate the answers. + :type query: str + :return: result object + :rtype: dict + """ + self._valid_query_state_check() + return eval_and_free(self.m, query) + + +if __name__ == '__main__': + + + with ScryerMachine(":- use_module(library(dif)). " + ":- use_module(library(lists)).") as wam: + with wam.lazy_eval_context('member(X, [a,"a",f(a),"f(a)",Y,"Y", true, "true", false, "false"]).') as query: + for goal in query: + print(goal) + + # # {'X': 'a'} + # # {'X': 'a'} + # # {'X': 'f(a)'} + # # {'X': 'f(a)'} + # # {'Y': 'X'} + # # {'X': 'Y'} + # # {'X': '_150', 'Y': '_180'} + + with ScryerMachine(""" + :- use_module(library(dcgs)). + :- use_module(library(lists)). + :- use_module(library(clpz)). + + as --> []. + as --> [a], as. + """) as wam: + print('?- phrase(as, As).') + with wam.lazy_eval_context('phrase(as, As).') as query: + for n, answer in zip(range(10), query): + print(n, answer) + + # # 0 {'As': ['']} + # # 1 {'As': 'a'} + # # 2 {'As': 'aa'} + # # 3 {'As': 'aaa'} + # # 4 {'As': 'aaaa'} + # # 5 {'As': 'aaaaa'} + # # 6 {'As': 'aaaaaa'} + # # 7 {'As': 'aaaaaaa'} + # # 8 {'As': 'aaaaaaaa'} + # # 9 {'As': 'aaaaaaaaa'} + # + source = """ + :- use_module(library(dcgs)). + :- use_module(library(lists)). + :- use_module(library(clpz)). + + as --> []. + as --> [a], as. + + fact(0). + fact(1). + fact(2). + """ + + with ScryerMachine(source) as wam: + with ScryerMachine(source) as wam1: + with wam.lazy_eval_context('phrase(as, As).') as query1: + for n, a in zip(range(3), query1): + with wam1.lazy_eval_context('fact(Fact).') as query2: + for i, fact in zip(range(3), query2): + print(n, i, fact, a) + + # 0 0 {'Fact': 0} {'As': ['']} + # 0 1 {'Fact': 1} {'As': ['']} + # 0 2 {'Fact': 2} {'As': ['']} + # 1 0 {'Fact': 0} {'As': 'a'} + # 1 1 {'Fact': 1} {'As': 'a'} + # 1 2 {'Fact': 2} {'As': 'a'} + # 2 0 {'Fact': 0} {'As': 'aa'} + # 2 1 {'Fact': 1} {'As': 'aa'} + # 2 2 {'Fact': 2} {'As': 'aa'} + diff --git a/src/ffi/mod.rs b/src/ffi/mod.rs new file mode 100644 index 000000000..71c6ab246 --- /dev/null +++ b/src/ffi/mod.rs @@ -0,0 +1,4 @@ +#[cfg(not(target_arch = "wasm32"))] +pub mod shared_library; +#[cfg(target_arch = "wasm32")] +pub mod wasm; diff --git a/src/ffi/shared_library.rs b/src/ffi/shared_library.rs new file mode 100644 index 000000000..a9f587877 --- /dev/null +++ b/src/ffi/shared_library.rs @@ -0,0 +1,252 @@ +#![doc = include_str!(concat!(env!("CARGO_MANIFEST_DIR"),"/docs/shared_library/README.md"))] + +use std::ffi::{c_char, CStr, CString}; + +use serde_json::json; + +use crate::machine::lib_machine::QueryState; +use crate::machine::Machine; + +/// Create a new instance of the Scryer Machine. +/// +/// +/// It is the caller's responsibility to maintain a reference to the machine pointer +/// created by this function, passing it to [`machine_free`] to deallocate +/// resources. Failure to do so may lead to memory leaks. +/// +#[export_name = "scryer_machine_new"] +pub extern "C" fn machine_new() -> *mut Machine { + let machine = Box::into_raw(Box::new(Machine::new_lib())); + machine +} + +/// Frees the memory occupied by a [`Machine`] object. +/// +/// # Safety +/// +/// * It is the caller's responsibility to ensure that the input is a valid [`Machine`] pointer +/// created by [`machine_new`] that has not yet been freed by this function. +/// * Any [`QueryState`] instances associated with this machine should be deallocated prior +/// to calling this function on the input, otherwise those [`QueryState`] instances may +/// not be deallocated until the program terminates. +/// +#[export_name = "scryer_machine_free"] +pub unsafe extern "C" fn machine_free(ptr: *mut Machine) { + unsafe { + drop(Box::from_raw(ptr)); + } +} + +/// Returns a new query generator for the given virtual machine. Null pointer returned +/// if string is not valid UTF-8. +/// +/// # Safety +/// +/// Caller must satisfy the following preconditions for this function: +/// +/// * Valid [`Machine`] pointer created with [`machine_new`] that has not yet been freed. +/// * the input fulfill the safety requirements of [`CStr::from_ptr`]. +/// * There must be no other [`QueryState`] for this [`Machine`] started by +/// [`run_query_iter`] that has not yet been freed with +/// [`query_state_free`] or the [`Machine`] state will enter an undefined +/// configuration with unpredictable results. +/// +/// Other concerns: +/// * after invoking this function, calling any other function besides [`run_query_next`] +/// before invoking [`query_state_free`] on the [`QueryState`] pointer +/// will leave the [`Machine`] in an undefined state +/// +#[export_name = "scryer_run_query_iter"] +pub unsafe extern "C" fn run_query_iter( + machine: &mut Machine, + input: *const c_char, +) -> *mut QueryState { + match unsafe { CStr::from_ptr(input) }.to_str() { + Ok(input) => { + let string = input.to_string(); + let query_state = machine.run_query_iter(string); + Box::into_raw(Box::new(query_state)) + } + Err(_) => std::ptr::null_mut(), + } +} + +/// Cleans up the [`QueryState`] in the associated Scryer [`Machine`]. +/// +/// # Safety +/// +/// * `query_state` must be a valid mutable pointer to a [`QueryState`] created by [`run_query_iter`] +/// that has not yet been freed by [`query_state_free`]. +/// * There can be only one [`QueryState`] per [`Machine`] started by +/// [`run_query_iter`] that has not yet been freed with +/// [`query_state_free`] or the [`Machine`] state will enter an undefined +/// configuration with unpredictable results. +#[export_name = "scryer_query_state_free"] +pub unsafe extern "C" fn query_state_free(query_state: *mut QueryState) { + unsafe { + drop(Box::from_raw(query_state)); + } +} + +/// Returns a NULL POINTER if no addition iterations, else returns a +/// UTF-8 encoded JSON string with one iteration of results from a Scryer Prolog query. +/// +/// See documentation for known limitations (e.g., concrete goals only). +/// +/// # Safety +/// +/// * `query_state` must be a valid mutable pointer to a [`QueryState`] created by [`run_query_iter`] +/// that has not yet been freed by [`query_state_free`]. +/// * There can be only one [`QueryState`] per [`Machine`] started by +/// [`run_query_iter`] that has not yet been freed with +/// [`query_state_free`] or the [`Machine`] state will enter an undefined +/// configuration with unpredictable results. +#[export_name = "scryer_run_query_next"] +pub extern "C" fn run_query_next(query_state: &mut QueryState) -> *mut c_char { + match query_state.next() { + None => std::ptr::null_mut(), + Some(Ok(query_resolution_line)) => { + // let v = QueryResolution::from(vec![query_resolution_line]).to_string(); + + // let obj = serde_json::from_str::(query_resolution_line).expect("Bad JSON"); + + let output_string = json!({ + "status": "ok", + "result": query_resolution_line + }) + .to_string(); + + CString::new(output_string.to_string()).unwrap().into_raw() + } + Some(Err(err)) => { + let output_string = json!({ + "status": "error", + "error": err.to_string(), + }) + .to_string(); + + CString::new(output_string.to_string()).unwrap().into_raw() + } + } +} + +/// Consults a Scryer Prolog module from a string, optionally with a given module name. +/// Will panic if provided invalid Scryer Prolog code. +/// +/// # Safety +/// +/// * `machine` must be a valid mutable pointer to a [`Machine`] created by +/// [`machine_new`] that has not yet been freed. +/// * `input` must be a valid pointer to a null terminated UTF-8 string of valid +/// Scryer Prolog code that satisfies the safety requirements of [`CStr::from_ptr`]. +/// * `module_name`, must be a valid pointer to a null terminated UTF-8 string +/// of a valid Prolog module name that satisfies the safety requirements of +/// [`CStr::from_ptr`]. +/// * there must be no [`QueryState`] for this [`Machine`] that has been created by +/// [`run_query_iter`] that has not yet been freed by +/// [`query_state_free`], or the [`Machine`] will enter an undefined state +/// with unpredictable behavior. +/// +/// # Arguments +/// +/// * `machine` - A mutable reference to the [`Machine`] to load the module into. +/// * `module_name` - A pointer to a null-terminated UTF-8 string representing +/// Scryer Prolog module name. +/// * `input` - A pointer to a null-terminated UTF-8 string representing Scryer Prolog code. +/// +#[export_name = "scryer_consult_module_string"] +pub unsafe extern "C" fn consult_module_string( + machine: &mut Machine, + module_name: *const c_char, + input: *const c_char, +) { + let c_str: &CStr; + unsafe { + c_str = CStr::from_ptr(input); + } + let r_str = c_str.to_str().expect("Not a valid UTF-8 string"); + + let m_str: &CStr; + unsafe { + m_str = CStr::from_ptr(module_name); + } + let module_name = m_str.to_str().expect("Not a valid UTF-8 string"); + + machine.consult_module_string(&module_name, r_str.to_owned()) +} + +/// Greedily evaluate a prolog query, returning all results in a JSON-formatted string. +/// Errors are printed to stderr and a null pointer is returned. +/// +/// # Safety +/// +/// * `machine` must be a valid [`Machine`] pointer created with [`machine_new`] +/// that has not yet been freed. +/// * There must be no existing [`QueryState`] for this [`Machine`] started by +/// [`run_query_iter`] that has not yet been freed with +/// [`query_state_free`] or the [`Machine`] state will enter an undefined +/// configuration with unpredictable results. +/// * it is the responsibility of the caller to deallocate the pointer returned by +/// this function with [`scyer_free_c_string`] in order to avoid memory leaks. +/// +/// +/// # Returns +/// - Returns a pointer to a JSON formatted, null terminated UTF-8 string +/// +/// # Response Format +/// ```json +/// // if result is a binding +/// +/// // current limitation is that only concrete (equality) bindings are returned, +/// // residual goals not yet supported. +/// { +/// "status": "ok", +/// "result": [{ ... }], +/// } +/// +/// // if result is a boolean goal +/// +/// { +/// "status": "ok", +/// "result": boolean +/// } +#[export_name = "scryer_run_query"] +pub unsafe extern "C" fn run_query(machine: &mut Machine, input: *const c_char) -> *mut c_char { + let c_string; + let r_str; + unsafe { + c_string = CStr::from_ptr(input); + }; + r_str = c_string.to_str().expect("Not a valid UTF-8 string"); + let query_resolution = machine.run_query(r_str.to_owned()); + + let output_string: String = match query_resolution { + Ok(query_resolution_line) => { + // let value: Value = + // serde_json::from_str(&format!("{:?}", query_resolution_line)).unwrap(); + json!( { + "status": "ok", + "result": query_resolution_line + }) + .to_string() + } + Err(err) => { + eprintln!("Error {err}"); + return std::ptr::null_mut(); + } + }; + CString::new(output_string).unwrap().into_raw() +} + +/// Deallocate a Scryer Prolog string. +/// +/// # Safety +/// +/// * it is the caller's responsibility to ensure the `ptr` is not deallocated more than +/// once. +#[export_name = "scryer_free_c_string"] +pub unsafe extern "C" fn free_c_string(ptr: *mut c_char) { + unsafe { + let _ = CString::from_raw(ptr); + } +} diff --git a/src/ffi/wasm.rs b/src/ffi/wasm.rs new file mode 100644 index 000000000..370064c5b --- /dev/null +++ b/src/ffi/wasm.rs @@ -0,0 +1,12 @@ +use wasm_bindgen::prelude::*; + +#[wasm_bindgen] +pub fn eval_code(s: &str) -> String { + use machine::mock_wam::*; + + console_error_panic_hook::set_once(); + + let mut wam = Machine::with_test_streams(); + let bytes = wam.test_load_string(s); + String::from_utf8_lossy(&bytes).to_string() +} diff --git a/src/lib.rs b/src/lib.rs index 90f498a30..748758be2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,10 +1,12 @@ #![recursion_limit = "4112"] -#[macro_use] -extern crate static_assertions; #[cfg(test)] #[macro_use] extern crate maplit; +#[macro_use] +extern crate static_assertions; + +use instructions::instr; #[macro_use] pub mod macros; @@ -18,8 +20,7 @@ mod allocator; mod arithmetic; pub mod codegen; mod debray_allocator; -#[cfg(feature = "ffi")] -mod ffi; + mod forms; mod heap_iter; pub mod heap_print; @@ -40,19 +41,4 @@ mod repl_helper; mod targets; pub mod types; -use instructions::instr; - -#[cfg(target_arch = "wasm32")] -use wasm_bindgen::prelude::*; - -#[cfg(target_arch = "wasm32")] -#[wasm_bindgen] -pub fn eval_code(s: &str) -> String { - use machine::mock_wam::*; - - console_error_panic_hook::set_once(); - - let mut wam = Machine::with_test_streams(); - let bytes = wam.test_load_string(s); - String::from_utf8_lossy(&bytes).to_string() -} +pub mod ffi; diff --git a/src/ffi.rs b/src/machine/ffi.rs similarity index 100% rename from src/ffi.rs rename to src/machine/ffi.rs diff --git a/src/machine/lib_machine.rs b/src/machine/lib_machine.rs index e44e54e4e..10bec91f1 100644 --- a/src/machine/lib_machine.rs +++ b/src/machine/lib_machine.rs @@ -9,6 +9,7 @@ use crate::parser::parser::{Parser, Tokens}; use crate::read::{write_term_to_heap, TermWriteResult}; use indexmap::IndexMap; +use super::QueryMatch; use super::{ streams::Stream, Atom, AtomCell, HeapCellValue, HeapCellValueTag, Machine, MachineConfig, QueryResolutionLine, QueryResult, Value, @@ -138,7 +139,7 @@ impl Iterator for QueryState<'_> { // choice point, so we should break. self.machine.machine_st.backtrack(); - Some(Ok(QueryResolutionLine::Match(bindings))) + Some(Ok(QueryResolutionLine::Match(QueryMatch { bindings }))) } } @@ -271,10 +272,10 @@ mod tests { output, Ok(QueryResolution::Matches(vec![ QueryMatch::from(btreemap! { - "P" => Value::from("p1"), + "P" => Value::String("p1".into()), }), QueryMatch::from(btreemap! { - "P" => Value::from("p2"), + "P" => Value::String("p2".into()), }), ])) ); @@ -425,10 +426,10 @@ mod tests { output, Ok(QueryResolution::Matches(vec![ QueryMatch::from(btreemap! { - "P" => Value::from("p1"), + "P" => Value::String("p1".into()), }), QueryMatch::from(btreemap! { - "P" => Value::from("p2"), + "P" => Value::String("p2".into()), }), ])) ); @@ -463,50 +464,6 @@ mod tests { ); } - #[test] - #[cfg_attr(miri, ignore = "it takes too long to run")] - #[ignore = "uses old flawed interface"] - fn integration_test() { - let mut machine = Machine::new_lib(); - - // File with test commands, i.e. program code to consult and queries to run - let code = include_str!("./lib_integration_test_commands.txt"); - - // Split the code into blocks - let blocks = code.split("====="); - - let mut i = 0; - let mut last_result: Option<_> = None; - // Iterate over the blocks - for block in blocks { - // Trim the block to remove any leading or trailing whitespace - let block = block.trim(); - - // Skip empty blocks - if block.is_empty() { - continue; - } - - // Check if the block is a query - if let Some(query) = block.strip_prefix("query") { - // Parse and execute the query - let result = machine.run_query(query.to_string()); - assert!(result.is_ok()); - - last_result = Some(result); - } else if let Some(code) = block.strip_prefix("consult") { - // Load the code into the machine - machine.consult_module_string("facts", code.to_string()); - } else if let Some(result) = block.strip_prefix("result") { - i += 1; - if let Some(Ok(ref last_result)) = last_result { - println!("\n\n=====Result No. {i}=======\n{last_result}\n==============="); - assert_eq!(last_result.to_string(), result.to_string().trim(),) - } - } - } - } - #[test] #[cfg_attr(miri, ignore = "it takes too long to run")] fn findall() { @@ -531,8 +488,8 @@ mod tests { btreemap! { "Result" => Value::List( Vec::from([ - Value::List([Value::from("p1"), Value::from("b")].into()), - Value::List([Value::from("p2"), Value::from("b")].into()), + Value::List([Value::String("p1".into()), Value::String("b".into())].into()), + Value::List([Value::String("p2".into()), Value::String("b".into())].into()), ]) ), } @@ -690,7 +647,7 @@ mod tests { let result = machine.run_query(query); let expected = Value::Structure( - // Composite term + // Compound term "a".into(), vec![ Value::String("asdf".into()), // String diff --git a/src/machine/machine_errors.rs b/src/machine/machine_errors.rs index 9f22d0e3b..4ae91ec94 100644 --- a/src/machine/machine_errors.rs +++ b/src/machine/machine_errors.rs @@ -2,9 +2,9 @@ use crate::arena::*; use crate::atom_table::*; use crate::parser::ast::*; -#[cfg(feature = "ffi")] -use crate::ffi::FFIError; use crate::forms::*; +#[cfg(feature = "ffi")] +use crate::machine::ffi::FFIError; use crate::machine::heap::*; use crate::machine::loader::CompilationTarget; use crate::machine::machine_state::*; diff --git a/src/machine/mod.rs b/src/machine/mod.rs index cfba56662..bb0c14ce2 100644 --- a/src/machine/mod.rs +++ b/src/machine/mod.rs @@ -28,16 +28,19 @@ pub mod system_calls; pub mod term_stream; pub mod unify; +#[cfg(feature = "ffi")] +mod ffi; + use crate::arena::*; use crate::arithmetic::*; use crate::atom_table::*; -#[cfg(feature = "ffi")] -use crate::ffi::ForeignFunctionTable; use crate::forms::*; use crate::instructions::*; use crate::machine::args::*; use crate::machine::compile::*; use crate::machine::copier::*; +#[cfg(feature = "ffi")] +use crate::machine::ffi::ForeignFunctionTable; use crate::machine::heap::*; use crate::machine::loader::*; use crate::machine::machine_errors::*; diff --git a/src/machine/parsed_results.rs b/src/machine/parsed_results.rs index 05b0f7f15..d48a37f82 100644 --- a/src/machine/parsed_results.rs +++ b/src/machine/parsed_results.rs @@ -1,134 +1,72 @@ +use std::cmp::Ordering; +use std::collections::BTreeMap; +use std::iter::FromIterator; + +use super::Machine; +use super::{HeapCellValue, Number}; use crate::atom_table::*; use crate::heap_iter::{stackful_post_order_iter, NonListElider}; use crate::machine::{F64Offset, F64Ptr, Fixnum, HeapCellValueTag}; use crate::parser::ast::{Var, VarPtr}; + use dashu::*; use indexmap::IndexMap; +use integer::IBig; +use integer::UBig; +use num_traits::cast::ToPrimitive; use ordered_float::OrderedFloat; -use std::cmp::Ordering; -use std::collections::BTreeMap; -use std::collections::HashMap; -use std::fmt::Display; -use std::fmt::Write; -use std::iter::FromIterator; - -use super::Machine; -use super::{HeapCellValue, Number}; +use serde::ser::SerializeMap; +use serde::ser::SerializeSeq; +use serde::Serialize; +use serde::Serializer; pub type QueryResult = Result; +#[derive(Debug, Clone, PartialEq, Eq, Serialize)] +pub struct QueryMatch { + pub bindings: BTreeMap, +} + #[derive(Debug, Clone, PartialEq, Eq)] -pub enum QueryResolution { +pub enum QueryResolutionLine { True, False, - Matches(Vec), + Match(QueryMatch), } -pub fn write_prolog_value_as_json( - writer: &mut W, - value: &Value, -) -> Result<(), std::fmt::Error> { - match value { - Value::Integer(i) => write!(writer, "{}", i), - Value::Float(f) => write!(writer, "{}", f), - Value::Rational(r) => write!(writer, "{}", r), - Value::Atom(a) => writer.write_str(a.as_str()), - Value::String(s) => { - if let Err(_e) = serde_json::from_str::(s.as_str()) { - //treat as string literal - //escape double quotes - write!( - writer, - "\"{}\"", - s.replace('\"', "\\\"") - .replace('\n', "\\n") - .replace('\t', "\\t") - .replace('\r', "\\r") - ) - } else { - //return valid json string - writer.write_str(s) - } - } - Value::List(l) => { - writer.write_char('[')?; - if let Some((first, rest)) = l.split_first() { - write_prolog_value_as_json(writer, first)?; - - for other in rest { - writer.write_char(',')?; - write_prolog_value_as_json(writer, other)?; - } - } - writer.write_char(']') - } - Value::Structure(s, l) => { - write!(writer, "\"{}\":[", s.as_str())?; - - if let Some((first, rest)) = l.split_first() { - write_prolog_value_as_json(writer, first)?; - for other in rest { - writer.write_char(',')?; - write_prolog_value_as_json(writer, other)?; - } - } - writer.write_char(']') +impl Serialize for QueryResolutionLine { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + match self { + QueryResolutionLine::True => serializer.serialize_bool(true), + QueryResolutionLine::False => serializer.serialize_bool(false), + QueryResolutionLine::Match(m) => m.serialize(serializer), } - _ => writer.write_str("null"), } } -fn write_prolog_match_as_json( - writer: &mut W, - query_match: &QueryMatch, -) -> Result<(), std::fmt::Error> { - writer.write_char('{')?; - let mut iter = query_match.bindings.iter(); - - if let Some((k, v)) = iter.next() { - write!(writer, "\"{k}\":")?; - write_prolog_value_as_json(writer, v)?; - - for (k, v) in iter { - write!(writer, ",\"{k}\":")?; - write_prolog_value_as_json(writer, v)?; - } - } - writer.write_char('}') +#[derive(Debug, Clone, PartialEq, Eq)] +pub enum QueryResolution { + True, + False, + Matches(Vec), } -impl Display for QueryResolution { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { +impl Serialize for QueryResolution { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { match self { - QueryResolution::True => f.write_str("true"), - QueryResolution::False => f.write_str("false"), - QueryResolution::Matches(matches) => { - f.write_char('[')?; - if let Some((first, rest)) = matches.split_first() { - write_prolog_match_as_json(f, first)?; - for other in rest { - f.write_char(',')?; - write_prolog_match_as_json(f, other)?; - } - } - f.write_char(']') - } + QueryResolution::True => serializer.serialize_bool(true), + QueryResolution::False => serializer.serialize_bool(false), + QueryResolution::Matches(matches) => matches.serialize(serializer), } } } -#[derive(Debug, Clone, PartialEq, Eq)] -pub struct QueryMatch { - pub bindings: BTreeMap, -} - -#[derive(Debug, Clone, PartialEq, Eq)] -pub enum QueryResolutionLine { - True, - False, - Match(BTreeMap), -} - #[derive(Debug, Clone, PartialEq, Eq)] pub enum Value { Integer(Integer), @@ -141,6 +79,212 @@ pub enum Value { Var(String), } +impl Value { + pub fn conjunction(conj: &[Value]) -> Value { + if conj.is_empty() { + panic!("can't create empty conjunction"); + } else if conj.len() == 1 { + return conj[0].clone(); + } + + let mut conj_rev = conj.iter().rev(); + + let last = conj_rev.next().unwrap().clone(); + let beflast = conj_rev.next().unwrap().clone(); + let mut conj_term = Value::Structure(",".into(), vec![beflast, last]); + + for val in conj_rev { + conj_term = Value::Structure(",".into(), vec![val.clone(), conj_term]); + } + + conj_term + } + + pub fn disjunction(disj: &[Value]) -> Value { + if disj.is_empty() { + panic!("can't create empty disjunction"); + } else if disj.len() == 1 { + return disj[0].clone(); + } + + let mut disj_rev = disj.iter().rev(); + + let last = disj_rev.next().unwrap().clone(); + let beflast = disj_rev.next().unwrap().clone(); + let mut disj_term = Value::Structure(";".into(), vec![beflast, last]); + + for val in disj_rev { + disj_term = Value::Structure(";".into(), vec![val.clone(), disj_term]); + } + + disj_term + } +} + +impl From<&QueryResolutionLine> for Value { + fn from(qrl: &QueryResolutionLine) -> Self { + match qrl { + QueryResolutionLine::True => Value::Atom("true".into()), + QueryResolutionLine::False => Value::Atom("false".into()), + QueryResolutionLine::Match(m) => Value::conjunction( + &m.bindings + .iter() + .map(|(k, v)| { + Value::Structure("=".into(), vec![Value::Var(k.clone()), v.clone()]) + }) + .collect::>(), + ), + } + } +} + +impl From<&QueryResolution> for Value { + fn from(qr: &QueryResolution) -> Self { + match qr { + QueryResolution::True => Value::Atom("true".into()), + QueryResolution::False => Value::Atom("false".into()), + QueryResolution::Matches(matches) => Value::disjunction( + &matches + .iter() + .map(|m| { + Value::conjunction( + &m.bindings + .iter() + .map(|(k, v)| { + Value::Structure( + "=".into(), + vec![Value::Var(k.clone()), v.clone()], + ) + }) + .collect::>(), + ) + }) + .collect::>(), + ), + } + } +} + +struct ValueRationalInner { + numerator: IBig, + denominator: UBig, +} + +impl Serialize for ValueRationalInner { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + let mut seq = serializer.serialize_seq(Some(2))?; + match self.numerator.to_i64() { + Some(small) => seq.serialize_element(&small)?, + None => seq.serialize_element(&self.numerator.to_string())?, + } + match self.denominator.to_u64() { + Some(small) => seq.serialize_element(&small)?, + None => seq.serialize_element(&self.denominator.to_string())?, + } + seq.end() + } +} + +impl Serialize for Value { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + match self { + Value::Integer(i) => match i.to_i64() { + Some(small) => serializer.serialize_i64(small), + None => { + let mut map = serializer.serialize_map(Some(1))?; + map.serialize_entry("integer", &i.to_string())?; + map.end() + } + }, + Value::Rational(r) => { + let (numerator, denominator) = r.clone().into_parts(); + let mut map = serializer.serialize_map(Some(1))?; + map.serialize_entry( + "rational", + &ValueRationalInner { + numerator, + denominator, + }, + )?; + map.end() + } + Value::Float(f) => serializer.serialize_f64(f.into_inner()), + Value::Atom(a) => match a.as_str() { + "true" => serializer.serialize_bool(true), + "false" => serializer.serialize_bool(false), + "[]" => { + // This should never be reached if this was obtained from run_query_iter(), + // but is here for completeness. + let seq = serializer.serialize_seq(Some(0))?; + seq.end() + } + _ => { + let mut map = serializer.serialize_map(Some(1))?; + map.serialize_entry("atom", a)?; + map.end() + } + }, + Value::String(s) => serializer.serialize_str(s), + Value::List(l) => l.serialize(serializer), + Value::Structure(f, args) => { + if f == "," && args.len() == 2 { + // Conjunction syntax sugar + let mut conj = vec![args[0].clone()]; + let mut curr_val = args[1].clone(); + loop { + if let Value::Structure(f, args) = &curr_val { + if f == "," && args.len() == 2 { + conj.push(args[0].clone()); + curr_val = args[1].clone(); + continue; + } + } + conj.push(curr_val); + break; + } + let mut map = serializer.serialize_map(Some(1))?; + map.serialize_entry("conjunction", &conj)?; + map.end() + } else if f == ";" && args.len() == 2 { + // Disjunction syntax sugar + let mut disj = vec![args[0].clone()]; + let mut curr_val = args[1].clone(); + loop { + if let Value::Structure(f, args) = &curr_val { + if f == ";" && args.len() == 2 { + disj.push(args[0].clone()); + curr_val = args[1].clone(); + continue; + } + } + disj.push(curr_val); + break; + } + let mut map = serializer.serialize_map(Some(1))?; + map.serialize_entry("disjunction", &disj)?; + map.end() + } else { + let mut map = serializer.serialize_map(Some(2))?; + map.serialize_entry("functor", f)?; + map.serialize_entry("args", args)?; + map.end() + } + } + Value::Var(v) => { + let mut map = serializer.serialize_map(Some(1))?; + map.serialize_entry("variable", v)?; + map.end() + } + } + } +} + /// This is an auxiliary function to turn a count into names of anonymous variables like _A, _B, /// _AB, etc... fn count_to_letter_code(mut count: usize) -> String { @@ -428,7 +572,7 @@ impl From> for QueryResolution { // If there is only one line, and it is an empty match, return false. if query_result_lines.len() == 1 { if let QueryResolutionLine::Match(m) = query_result_lines[0].clone() { - if m.is_empty() { + if m.bindings.is_empty() { return QueryResolution::False; } } @@ -448,10 +592,9 @@ impl From> for QueryResolution { // If there is at least one match, return all matches. let all_matches = query_result_lines .into_iter() - .filter(|l| matches!(l, QueryResolutionLine::Match(_))) - .map(|l| match l { - QueryResolutionLine::Match(m) => QueryMatch::from(m), - _ => unreachable!(), + .filter_map(|l| match l { + QueryResolutionLine::Match(m) => Some(m), + _ => None, }) .collect::>(); @@ -471,173 +614,171 @@ impl FromIterator for QueryResolution { } } -fn split_response_string(input: &str) -> Vec { - let mut level_bracket = 0; - let mut level_parenthesis = 0; - let mut in_double_quotes = false; - let mut in_single_quotes = false; - let mut start = 0; - let mut result = Vec::new(); - - for (i, c) in input.chars().enumerate() { - match c { - '[' => level_bracket += 1, - ']' => level_bracket -= 1, - '(' => level_parenthesis += 1, - ')' => level_parenthesis -= 1, - '"' => in_double_quotes = !in_double_quotes, - '\'' => in_single_quotes = !in_single_quotes, - ',' if level_bracket == 0 - && level_parenthesis == 0 - && !in_double_quotes - && !in_single_quotes => - { - result.push(input[start..i].trim().to_string()); - start = i + 1; - } - _ => {} - } - } - - result.push(input[start..].trim().to_string()); - result -} - -fn split_key_value_pairs(input: &str) -> Vec<(String, String)> { - let items = split_response_string(input); - let mut result = Vec::new(); - - for item in items { - let parts: Vec<&str> = item.splitn(2, '=').collect(); - if parts.len() == 2 { - let key = parts[0].trim().to_string(); - let value = parts[1].trim().to_string(); - result.push((key, value)); - } - } - - result -} +#[cfg(test)] +mod tests { + use rational::RBig; + use serde_json::json; + + use super::*; + + #[test] + fn value_json_serialize() { + let ibig = IBig::from(10).pow(100); + let ubig = UBig::from(7u32).pow(100); + let prolog_value = Value::Structure( + "a".into(), + vec![ + Value::Atom("asdf".into()), + Value::Atom("true".into()), + Value::Atom("false".into()), + Value::String("fdsa".into()), + Value::List(vec![Value::Integer(1.into()), Value::Float(2.43.into())]), + Value::Integer(ibig.clone()), + Value::Rational(RBig::from_parts(1.into(), 7u32.into())), + Value::Rational(RBig::from_parts(ibig.clone(), 7u32.into())), + Value::Rational(RBig::from_parts(1.into(), ubig.clone())), + Value::Rational(RBig::from_parts(ibig.clone(), ubig.clone())), + Value::Var("X".into()), + ], + ); -fn parse_prolog_response(input: &str) -> HashMap { - let mut map: HashMap = HashMap::new(); - // Use regex to match strings including commas inside them - for result in split_key_value_pairs(input) { - let key = result.0; - let value = result.1; - // cut off at given characters/strings: - let value = value.split('\n').next().unwrap().to_string(); - let value = value.split(' ').next().unwrap().to_string(); - let value = value.split('\t').next().unwrap().to_string(); - let value = value.split("error").next().unwrap().to_string(); - map.insert(key, value); + let json_value = json!({ + "functor": "a", + "args": [ + { "atom": "asdf" }, + true, + false, + "fdsa", + [1, 2.43], + { "integer": ibig.to_string() }, + { "rational": [1, 7] }, + { "rational": [ibig.to_string(), 7] }, + { "rational": [1, ubig.to_string()] }, + { "rational": [ibig.to_string(), ubig.to_string()] }, + { "variable": "X" }, + ], + }); + + assert_eq!(json_value, serde_json::to_value(prolog_value).unwrap()); } - map -} - -impl TryFrom for QueryResolutionLine { - type Error = (); - fn try_from(string: String) -> Result { - match string.as_str() { - "true" => Ok(QueryResolutionLine::True), - "false" => Ok(QueryResolutionLine::False), - _ => Ok(QueryResolutionLine::Match( - parse_prolog_response(&string) - .iter() - .map(|(k, v)| -> Result<(String, Value), ()> { - let key = k.to_string(); - let value = v.to_string(); - Ok((key, Value::try_from(value)?)) - }) - .filter_map(Result::ok) - .collect::>(), - )), - } + #[test] + fn value_json_serialize_conjuntions() { + let prolog_value = Value::List(vec![ + Value::Structure( + ",".into(), + vec![ + Value::Integer(1.into()), + Value::Structure( + ",".into(), + vec![Value::String("asdf".into()), Value::Atom("fdsa".into())], + ), + ], + ), + Value::Structure( + ",".into(), + vec![ + Value::Integer(1.into()), + Value::String("asdf".into()), + Value::Atom("fdsa".into()), + ], + ), + ]); + + let json_value = json!([ + { "conjunction": [1, "asdf", { "atom": "fdsa" }] }, + { "functor": ",", "args": [1, "asdf", { "atom": "fdsa" }] }, + ]); + + assert_eq!(json_value, serde_json::to_value(prolog_value).unwrap()); } -} -fn split_nested_list(input: &str) -> Vec { - let mut level = 0; - let mut start = 0; - let mut result = Vec::new(); - - for (i, c) in input.chars().enumerate() { - match c { - '[' => level += 1, - ']' => level -= 1, - ',' if level == 0 => { - result.push(input[start..i].trim().to_string()); - start = i + 1; - } - _ => {} - } + #[test] + fn value_json_serialize_disjunctions() { + let prolog_value = Value::List(vec![ + Value::Structure( + ";".into(), + vec![ + Value::Integer(1.into()), + Value::Structure( + ";".into(), + vec![Value::String("asdf".into()), Value::Atom("fdsa".into())], + ), + ], + ), + Value::Structure( + ";".into(), + vec![ + Value::Integer(1.into()), + Value::String("asdf".into()), + Value::Atom("fdsa".into()), + ], + ), + ]); + + let json_value = json!([ + { "disjunction": [1, "asdf", { "atom": "fdsa" }] }, + { "functor": ";", "args": [1, "asdf", { "atom": "fdsa" }] }, + ]); + + assert_eq!(json_value, serde_json::to_value(prolog_value).unwrap()); } - result.push(input[start..].trim().to_string()); - result -} - -impl TryFrom for Value { - type Error = (); - fn try_from(string: String) -> Result { - let trimmed = string.trim(); - - if let Ok(float_value) = string.parse::() { - Ok(Value::Float(OrderedFloat(float_value))) - } else if let Ok(int_value) = string.parse::() { - Ok(Value::Integer(int_value.into())) - } else if trimmed.starts_with('\'') && trimmed.ends_with('\'') - || trimmed.starts_with('"') && trimmed.ends_with('"') - { - Ok(Value::String(trimmed[1..trimmed.len() - 1].into())) - } else if trimmed.starts_with('[') && trimmed.ends_with(']') { - let split = split_nested_list(&trimmed[1..trimmed.len() - 1]); - - let values = split - .into_iter() - .map(Value::try_from) - .collect::, _>>()?; - - Ok(Value::List(values)) - } else if trimmed.starts_with('{') && trimmed.ends_with('}') { - let iter = trimmed[1..trimmed.len() - 1].split(','); - let mut values = vec![]; - - for value in iter { - let items: Vec<_> = value.split(':').collect(); - if items.len() == 2 { - let _key = items[0].to_string(); - let value = items[1].to_string(); - values.push(Value::try_from(value)?); - } - } - - Ok(Value::Structure("{}".into(), values)) - } else if trimmed.starts_with("<<") && trimmed.ends_with(">>") { - let iter = trimmed[2..trimmed.len() - 2].split(','); - let mut values = vec![]; - - for value in iter { - let items: Vec<_> = value.split(':').collect(); - if items.len() == 2 { - let _key = items[0].to_string(); - let value = items[1].to_string(); - values.push(Value::try_from(value)?); - } - } - - Ok(Value::Structure("<<>>".into(), values)) - } else if !trimmed.contains(',') && !trimmed.contains('\'') && !trimmed.contains('"') { - Ok(Value::String(trimmed.into())) - } else { - Err(()) - } + #[test] + fn query_resolution_line_json() { + let qrl = QueryResolutionLine::True; + let json_value = json!(true); + assert_eq!(json_value, serde_json::to_value(qrl).unwrap()); + + let qrl = QueryResolutionLine::False; + let json_value = json!(false); + assert_eq!(json_value, serde_json::to_value(qrl).unwrap()); + + let qrl = QueryResolutionLine::Match(QueryMatch::from(btreemap! { + "X" => Value::Atom("asdf".into()), + "Y" => Value::String("fdsa".into()), + })); + let json_value = json!({ + "bindings": { + "X": { "atom": "asdf" }, + "Y": "fdsa", + }, + }); + assert_eq!(json_value, serde_json::to_value(qrl).unwrap()); } -} -impl From<&str> for Value { - fn from(str: &str) -> Self { - Value::String(str.to_string()) + #[test] + fn query_resolution_json() { + let qrl = QueryResolution::True; + let json_value = json!(true); + assert_eq!(json_value, serde_json::to_value(qrl).unwrap()); + + let qrl = QueryResolution::False; + let json_value = json!(false); + assert_eq!(json_value, serde_json::to_value(qrl).unwrap()); + + let qrl = QueryResolution::Matches(vec![ + QueryMatch::from(btreemap! { + "X" => Value::Atom("a".into()), + }), + QueryMatch::from(btreemap! { + "X" => Value::Atom("b".into()), + "Y" => Value::Atom("c".into()), + }), + ]); + let json_value = json!([ + { + "bindings": { + "X": { "atom": "a" }, + }, + }, + { + "bindings": { + "X": { "atom": "b" }, + "Y": { "atom": "c" }, + }, + }, + ]); + assert_eq!(json_value, serde_json::to_value(qrl).unwrap()); } } diff --git a/src/machine/system_calls.rs b/src/machine/system_calls.rs index ce5803756..76f9c6915 100644 --- a/src/machine/system_calls.rs +++ b/src/machine/system_calls.rs @@ -8,8 +8,6 @@ use num_order::NumOrd; use crate::arena::*; use crate::atom_table::*; -#[cfg(feature = "ffi")] -use crate::ffi::*; use crate::forms::*; use crate::heap_iter::*; use crate::heap_print::*; @@ -19,6 +17,8 @@ use crate::instructions::*; use crate::machine; use crate::machine::code_walker::*; use crate::machine::copier::*; +#[cfg(feature = "ffi")] +use crate::machine::ffi::*; use crate::machine::heap::*; use crate::machine::machine_errors::*; use crate::machine::machine_indices::*; @@ -4745,7 +4745,10 @@ impl Machine { let return_value = self.deref_register(3); if let Some(function_name) = self.machine_st.value_to_str_like(function_name) { let stub_gen = || functor_stub(atom!("foreign_call"), 3); - fn map_arg(machine_st: &mut MachineState, source: HeapCellValue) -> crate::ffi::Value { + fn map_arg( + machine_st: &mut MachineState, + source: HeapCellValue, + ) -> crate::machine::ffi::Value { match Number::try_from(source) { Ok(Number::Fixnum(n)) => Value::Int(n.get_num()), Ok(Number::Float(n)) => Value::Float(n.into_inner()), diff --git a/tests/scryer/main.rs b/tests/scryer/main.rs index bb77f334b..25a4de1fc 100644 --- a/tests/scryer/main.rs +++ b/tests/scryer/main.rs @@ -1,5 +1,6 @@ mod helper; mod issues; +mod shared_library_tests; mod src_tests; /// To add new cli test copy an existing .toml file in `tests/scryer/cli/issues/` or `tests/scryer/cli/issues/src_tests/`, diff --git a/tests/scryer/shared_library_tests.rs b/tests/scryer/shared_library_tests.rs new file mode 100644 index 000000000..643fbc2c3 --- /dev/null +++ b/tests/scryer/shared_library_tests.rs @@ -0,0 +1,280 @@ +#[cfg(test)] +mod shared_library_tests { + use std::ffi::{CStr, CString}; + + use scryer_prolog::ffi::shared_library::{ + consult_module_string, free_c_string, machine_free, machine_new, query_state_free, + run_query, run_query_iter, run_query_next, + }; + use scryer_prolog::machine::Machine; + use serde_json::{json, Value}; + + #[test] + fn test_scryer_run_multiple_queries_greedy_evaluation() { + let queries = vec![ + CString::new("true.").unwrap(), + CString::new("false.").unwrap(), + CString::new("X=2.").unwrap(), + CString::new("member(a, [a, b, c]).").unwrap(), + CString::new(r#"member(A, [a, b, c, "a", "b", "c", f(a), "f(a)", [1, 2, 3]])."#) + .unwrap(), + ]; + + let expected_results = vec![ + json!({"status": "ok", "result": true}), + json!({"status": "ok", "result": false}), + json!({"status": "ok", "result": [{"bindings": {"X":2}}]}), + json!({"status": "ok", "result": true}), + json!({"status": "ok", "result": [ + {"bindings": {"A": {"atom": "a"}}}, + {"bindings": {"A": {"atom": "b"}}}, + {"bindings": {"A": {"atom": "c"}}}, + {"bindings": {"A": "a"}}, + {"bindings": {"A": "b"}}, + {"bindings": {"A": "c"}}, + {"bindings": {"A": {"args": [{"atom": "a"}], "functor": "f"}}}, + {"bindings": {"A": "f(a)"}}, + {"bindings": {"A": [1, 2, 3]}} + ]}), + ]; + + let machine_ptr: *mut Machine = machine_new(); + let module_name = CString::new("tests").unwrap(); + let program = CString::new(":- use_module(library(lists)).").unwrap(); + unsafe { + consult_module_string(&mut *machine_ptr, module_name.as_ptr(), program.as_ptr()); + } + + for (query, expected) in queries.iter().zip(expected_results.iter()) { + let result = unsafe { run_query(&mut *machine_ptr, query.as_ptr()) }; + let cstr = unsafe { CStr::from_ptr(result) }; + let output_string = cstr.to_str().unwrap().to_owned(); + let deserialized: Value = serde_json::from_str(&output_string).unwrap(); + assert_eq!(expected, &deserialized); + unsafe { free_c_string(result) }; + } + + unsafe { + machine_free(machine_ptr); + } + } + + #[test] + fn test_scryer_run_query_equal_variables() { + let program = + CString::new(":- use_module(library(lists)). :- use_module(library(dif)).").unwrap(); + let module_name = CString::new("facts").unwrap(); + let query = CString::new("X=Y.").unwrap(); + let machine_ptr: *mut Machine = machine_new(); + + assert!(!machine_ptr.is_null()); + unsafe { + consult_module_string(&mut *machine_ptr, module_name.as_ptr(), program.as_ptr()); + } + let query_state = unsafe { run_query_iter(&mut *machine_ptr, query.as_ptr()) }; + + let expected_results = + [r#"{"result":{"bindings": {"X":{"variable": "Y"}}},"status":"ok"}"#]; + + let query_state_ref = unsafe { &mut *query_state }; + for expected in &expected_results { + let result_ptr = run_query_next(&mut *query_state_ref); + let result_char = unsafe { CStr::from_ptr(result_ptr) }; + let result_s = result_char.to_str().unwrap(); + let result_obj = serde_json::from_str::(result_s).expect("Bad JSON"); + let expected_obj = + serde_json::from_str::(expected).expect("Bad JSON"); + println!("{result_s:?}"); + assert_eq!(expected_obj, result_obj); + unsafe { + free_c_string(result_ptr); + } + } + + unsafe { query_state_free(query_state) } + unsafe { + machine_free(machine_ptr); + } + } + + #[test] + fn test_scryer_run_query_true_members() { + let program = + CString::new(":- use_module(library(lists)). :- use_module(library(dif)).").unwrap(); + let module_name = CString::new("facts").unwrap(); + let query = + CString::new(r#"member(X, [a,"a",f(a),"f(a)", true, "true", false, "false"])."#) + .unwrap(); + let machine_ptr: *mut Machine = machine_new(); + unsafe { + consult_module_string(&mut *machine_ptr, module_name.as_ptr(), program.as_ptr()); + } + let query_state = unsafe { run_query_iter(&mut *machine_ptr, query.as_ptr()) }; + + let expected_results = vec![ + json!({"status": "ok", "result": {"bindings": {"X": {"atom": "a"}}}}), + json!({"status": "ok", "result": {"bindings": {"X": "a"}}}), + json!({"status": "ok", "result": {"bindings": {"X": {"args": [{"atom": "a"}], "functor": "f"}}}}), + json!({"status": "ok", "result": {"bindings": {"X": "f(a)"}}}), + json!({"status": "ok", "result": {"bindings": {"X": true}}}), + json!({"status": "ok", "result": {"bindings": {"X": "true"}}}), + json!({"status": "ok", "result": {"bindings": {"X": false}}}), + json!({"status": "ok", "result": {"bindings": {"X": "false"}}}), + ]; + + let query_state_ref = unsafe { &mut *query_state }; + for expected in &expected_results { + let result_ptr = run_query_next(query_state_ref); + let result_char = unsafe { CStr::from_ptr(result_ptr) }; + let result_s = result_char.to_str().unwrap(); + let result_obj = + serde_json::from_str::(&result_s).expect("Bad JSON"); + assert_eq!(expected, &result_obj); + unsafe { + free_c_string(result_ptr); + } + } + } + + #[test] + fn test_scryer_run_query_jug_test() { + let program = CString::new( + "/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + Sparrows over Eagles + https://www.youtube.com/watch?v=vdabv9EkYrY + + jug(ID,Capacity,Fill) represents a jug + + general pattern: + + moves(StateList) --> [ ], + { preconditions*, postconditions* }, + +- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ + +:- use_module(library(clpz)). +:- use_module(library(dcgs)). +:- use_module(library(lists)). + + + +moves(Js0) --> { member(jug(a,_,1), Js0), + member(jug(b,_,1), Js0)}. + +moves(Js0) --> [fill(ID)], + { select(jug(ID, C, _), Js0, Js) }, + moves([jug(ID,C,C)|Js]). + +moves(Js0) --> [empty(ID)], + { select(jug(ID, C, _), Js0, Js) }, + moves([jug(ID,C,0)|Js]). + +moves(Js0) --> [from_to(F,T)], + { + select(jug(F,FC,FF0), Js0, Js1), % remove jug(F,FC,FF0) from Js0 resulting in Js1 + select(jug(T,TC,TF0), Js1, Js) , % remove jug(T,TC,TF0) from Js1 resulting in Js2 + FF0 #> 0, % source/from jug shouldn't be empty + TF0 #< TC, % target/to jug should not be full + M #= min(FF0, TC-TF0), % pour it all in (FF0) or top it up (TC-TF0) + FF #= FF0 - M, % reflect the water poured out from source jug + TF #= TF0 + M }, % reflect the water poured into the source jug + moves([jug(F, FC, FF), jug(T,TC,TF)|Js]). + +solve(N, Moves) :- + InitialState=moves([jug(a, 5, 2), jug(b,4,1), jug(c, 6, 5), jug(d,2,1), + jug(e,3,1)]), + length(Moves, N), % constrain length of moves to force iterative deepening + phrase(InitialState, Moves).", + ) + .unwrap(); + let module_name = CString::new("facts").unwrap(); + let query = CString::new(r#"solve(N, Moves)."#).unwrap(); + let machine_ptr: *mut Machine = machine_new(); + unsafe { + consult_module_string(&mut *machine_ptr, module_name.as_ptr(), program.as_ptr()); + } + let query_state = unsafe { run_query_iter(&mut *machine_ptr, query.as_ptr()) }; + + let expected_results = [ + r#"{"status": "ok", "result": {"bindings": {"Moves": [{"args": [{"atom": "a"}, {"atom": "c"}], "functor": "from_to"}], "N": 1}}}"#, + ]; + + let query_state_ref = unsafe { &mut *query_state }; + for expected in &expected_results { + let result_ptr = run_query_next(query_state_ref); + let result_char = unsafe { CStr::from_ptr(result_ptr) }; + let result_s = result_char.to_str().unwrap(); + let result_obj = + serde_json::from_str::(&result_s).expect("Bad JSON"); + let expected_obj = + serde_json::from_str::(&expected).expect("Bad JSON"); + assert_eq!(result_obj, expected_obj); + unsafe { + free_c_string(result_ptr); + } + } + unsafe { query_state_free(query_state) } + unsafe { machine_free(machine_ptr) }; + } + + #[test] + fn test_scryer_run_query_clpz() { + let program = CString::new(":- use_module(library(clpz)).").unwrap(); + let module_name = CString::new("facts").unwrap(); + let query = CString::new(r#"X in 1 .. 3."#).unwrap(); + let machine_ptr: *mut Machine = machine_new(); + unsafe { + consult_module_string(&mut *machine_ptr, module_name.as_ptr(), program.as_ptr()); + } + let query_state = unsafe { run_query_iter(&mut *machine_ptr, query.as_ptr()) }; + + let expected_results = + [r#"{"status": "ok", "result": {"bindings": {"X": {"variable": "_A"}}}}"#]; // incorrect + + let query_state_ref = unsafe { &mut *query_state }; + for expected in &expected_results { + let result_ptr = run_query_next(query_state_ref); + let result_char = unsafe { CStr::from_ptr(result_ptr) }; + let result_s = result_char.to_str().unwrap(); + let result_obj = + serde_json::from_str::(&result_s).expect("Bad JSON"); + let expected_obj = + serde_json::from_str::(&expected).expect("Bad JSON"); + assert_eq!(expected_obj, result_obj); + unsafe { + free_c_string(result_ptr); + } + } + unsafe { query_state_free(query_state) } + unsafe { machine_free(machine_ptr) }; + } + + #[test] + fn test_scryer_run_query_partial_list() { + let program = CString::new(":- use_module(library(lists)).").unwrap(); + let module_name = CString::new("facts").unwrap(); + let query = CString::new(r#"member(X, [["ab" | "dd"]])."#).unwrap(); + let machine_ptr: *mut Machine = machine_new(); + unsafe { + consult_module_string(&mut *machine_ptr, module_name.as_ptr(), program.as_ptr()); + } + let query_state = unsafe { run_query_iter(&mut *machine_ptr, query.as_ptr()) }; + + let expected_results = vec![ + json!({"status": "ok", "result": {"bindings": {"X": ["ab", {"atom": "d"}, {"atom": "d"}]}}}), + ]; + + let query_state_ref = unsafe { &mut *query_state }; + for expected in &expected_results { + let result_ptr = run_query_next(query_state_ref); + let result_char = unsafe { CStr::from_ptr(result_ptr) }; + let result_s = result_char.to_str().unwrap(); + let result_obj = + serde_json::from_str::(&result_s).expect("Bad JSON"); + assert_eq!(expected, &result_obj); + unsafe { + free_c_string(result_ptr); + } + } + } +} diff --git a/src/machine/lib_integration_test_commands.txt b/tests/scryer_lib/lib_integration_test_commands.txt similarity index 96% rename from src/machine/lib_integration_test_commands.txt rename to tests/scryer_lib/lib_integration_test_commands.txt index 153964705..52dbc7b74 100644 --- a/src/machine/lib_integration_test_commands.txt +++ b/tests/scryer_lib/lib_integration_test_commands.txt @@ -107,15 +107,14 @@ collection_getter(c, Base, "likedMessages", List) :- setof(Target, (triple(Base, collection_adder(c, "likedMessagess", '[{action: "addLink", source: "this", predicate: "flux://entry_type", target: "value"}]'). collection_remover(c, "likedMessagess", '[{action: "removeLink", source: "this", predicate: "flux://entry_type", target: "value"}]'). collection_setter(c, "likedMessagess", '[{action: "collectionSetter", source: "this", predicate: "flux://entry_type", target: "value"}]'). - =====query subject_class(X, _). =====result -[{"X":"Todo"}] +[{"bindings":{"X":"Todo"}}] =====query subject_class("Todo", C), constructor(C, Actions). =====result -[{"Actions":"[{action: \"addLink\", source: \"this\", predicate: \"todo://state\", target: \"todo://ready\"}]","C":"c"}] +[{"bindings":{"Actions":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"todo://state\", target: \"todo://ready\"}]"},"C":{"atom":"c"}}}] =====consult :- discontiguous(triple/3). :- discontiguous(link/5). @@ -230,19 +229,18 @@ collection_getter(c, Base, "likedMessages", List) :- setof(Target, (triple(Base, collection_adder(c, "likedMessagess", '[{action: "addLink", source: "this", predicate: "flux://entry_type", target: "value"}]'). collection_remover(c, "likedMessagess", '[{action: "removeLink", source: "this", predicate: "flux://entry_type", target: "value"}]'). collection_setter(c, "likedMessagess", '[{action: "collectionSetter", source: "this", predicate: "flux://entry_type", target: "value"}]'). - =====query subject_class("Todo", C), instance(C, "literal://string:construct%20test"). =====result -[{"C":"c"}] +[{"bindings":{"C":{"atom":"c"}}}] =====query subject_class("Todo", C), instance(C, "literal://string:construct%20test"). =====result -[{"C":"c"}] +[{"bindings":{"C":{"atom":"c"}}}] =====query subject_class("Todo", C), property(C, Property). =====result -[{"C":"c","Property":"state"},{"C":"c","Property":"title"},{"C":"c","Property":"isLiked"}] +[{"bindings":{"C":{"atom":"c"},"Property":"state"}},{"bindings":{"C":{"atom":"c"},"Property":"title"}},{"bindings":{"C":{"atom":"c"},"Property":"isLiked"}}] =====query subject_class("Todo", C), property_resolve(C, "state"). =====result @@ -250,7 +248,7 @@ false =====query subject_class("Todo", C), property_resolve(C, "title"). =====result -[{"C":"c"}] +[{"bindings":{"C":{"atom":"c"}}}] =====query subject_class("Todo", C), property_resolve(C, "isLiked"). =====result @@ -258,7 +256,7 @@ false =====query subject_class("Todo", C), property_setter(C, Property, Setter). =====result -[{"C":"c","Property":"state","Setter":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://state\", target: \"value\"}]"},{"C":"c","Property":"title","Setter":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://has_title\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"c"},"Property":"state","Setter":{"atom":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://state\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Property":"title","Setter":{"atom":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://has_title\", target: \"value\"}]"}}}] =====query subject_class("Todo", C), property_resolve_language(C, "state", Language). =====result @@ -266,31 +264,31 @@ false =====query subject_class("Todo", C), property_resolve_language(C, "title", Language). =====result -[{"C":"c","Language":"literal"}] +[{"bindings":{"C":{"atom":"c"},"Language":"literal"}}] =====query subject_class("Todo", C), collection(C, Collection). =====result -[{"C":"c","Collection":"comments"},{"C":"c","Collection":"entries"},{"C":"c","Collection":"messages"},{"C":"c","Collection":"likedMessages"}] +[{"bindings":{"C":{"atom":"c"},"Collection":"comments"}},{"bindings":{"C":{"atom":"c"},"Collection":"entries"}},{"bindings":{"C":{"atom":"c"},"Collection":"messages"}},{"bindings":{"C":{"atom":"c"},"Collection":"likedMessages"}}] =====query subject_class("Todo", C), collection_adder(C, Collection, Adder). =====result -[{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]","C":"c","Collection":"commentss"},{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]","C":"c","Collection":"entriess"},{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]","C":"c","Collection":"messagess"},{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]","C":"c","Collection":"likedMessagess"}] +[{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"commentss"}},{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"entriess"}},{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"messagess"}},{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"likedMessagess"}}] =====query subject_class("Todo", C), collection_remover(C, Collection, Remover). =====result -[{"C":"c","Collection":"commentss","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"},{"C":"c","Collection":"entriess","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"messagess","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"likedMessagess","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"c"},"Collection":"commentss","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"entriess","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"messagess","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"likedMessagess","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}}] =====query subject_class("Todo", C), collection_setter(C, Collection, Setter). =====result -[{"C":"c","Collection":"commentss","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"},{"C":"c","Collection":"entriess","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"messagess","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"likedMessagess","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"c"},"Collection":"commentss","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"entriess","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"messagess","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"likedMessagess","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}}] =====query subject_class("Todo", C), instance(C, "literal://string:construct%20test"). =====result -[{"C":"c"}] +[{"bindings":{"C":{"atom":"c"}}}] =====query subject_class("Todo", C), constructor(C, Actions). =====result -[{"Actions":"[{action: \"addLink\", source: \"this\", predicate: \"todo://state\", target: \"todo://ready\"}]","C":"c"}] +[{"bindings":{"Actions":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"todo://state\", target: \"todo://ready\"}]"},"C":{"atom":"c"}}}] =====consult :- discontiguous(triple/3). :- discontiguous(link/5). @@ -410,19 +408,18 @@ collection_getter(c, Base, "likedMessages", List) :- setof(Target, (triple(Base, collection_adder(c, "likedMessagess", '[{action: "addLink", source: "this", predicate: "flux://entry_type", target: "value"}]'). collection_remover(c, "likedMessagess", '[{action: "removeLink", source: "this", predicate: "flux://entry_type", target: "value"}]'). collection_setter(c, "likedMessagess", '[{action: "collectionSetter", source: "this", predicate: "flux://entry_type", target: "value"}]'). - =====query subject_class("Todo", C), instance(C, "literal://string:get%20proxy%20test"). =====result -[{"C":"c"}] +[{"bindings":{"C":{"atom":"c"}}}] =====query subject_class("Todo", C), instance(C, "literal://string:get%20proxy%20test"). =====result -[{"C":"c"}] +[{"bindings":{"C":{"atom":"c"}}}] =====query subject_class("Todo", C), property(C, Property). =====result -[{"C":"c","Property":"state"},{"C":"c","Property":"title"},{"C":"c","Property":"isLiked"}] +[{"bindings":{"C":{"atom":"c"},"Property":"state"}},{"bindings":{"C":{"atom":"c"},"Property":"title"}},{"bindings":{"C":{"atom":"c"},"Property":"isLiked"}}] =====query subject_class("Todo", C), property_resolve(C, "state"). =====result @@ -430,7 +427,7 @@ false =====query subject_class("Todo", C), property_resolve(C, "title"). =====result -[{"C":"c"}] +[{"bindings":{"C":{"atom":"c"}}}] =====query subject_class("Todo", C), property_resolve(C, "isLiked"). =====result @@ -438,7 +435,7 @@ false =====query subject_class("Todo", C), property_setter(C, Property, Setter). =====result -[{"C":"c","Property":"state","Setter":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://state\", target: \"value\"}]"},{"C":"c","Property":"title","Setter":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://has_title\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"c"},"Property":"state","Setter":{"atom":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://state\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Property":"title","Setter":{"atom":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://has_title\", target: \"value\"}]"}}}] =====query subject_class("Todo", C), property_resolve_language(C, "state", Language). =====result @@ -446,35 +443,35 @@ false =====query subject_class("Todo", C), property_resolve_language(C, "title", Language). =====result -[{"C":"c","Language":"literal"}] +[{"bindings":{"C":{"atom":"c"},"Language":"literal"}}] =====query subject_class("Todo", C), collection(C, Collection). =====result -[{"C":"c","Collection":"comments"},{"C":"c","Collection":"entries"},{"C":"c","Collection":"messages"},{"C":"c","Collection":"likedMessages"}] +[{"bindings":{"C":{"atom":"c"},"Collection":"comments"}},{"bindings":{"C":{"atom":"c"},"Collection":"entries"}},{"bindings":{"C":{"atom":"c"},"Collection":"messages"}},{"bindings":{"C":{"atom":"c"},"Collection":"likedMessages"}}] =====query subject_class("Todo", C), collection_adder(C, Collection, Adder). =====result -[{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]","C":"c","Collection":"commentss"},{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]","C":"c","Collection":"entriess"},{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]","C":"c","Collection":"messagess"},{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]","C":"c","Collection":"likedMessagess"}] +[{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"commentss"}},{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"entriess"}},{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"messagess"}},{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"likedMessagess"}}] =====query subject_class("Todo", C), collection_remover(C, Collection, Remover). =====result -[{"C":"c","Collection":"commentss","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"},{"C":"c","Collection":"entriess","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"messagess","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"likedMessagess","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"c"},"Collection":"commentss","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"entriess","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"messagess","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"likedMessagess","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}}] =====query subject_class("Todo", C), collection_setter(C, Collection, Setter). =====result -[{"C":"c","Collection":"commentss","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"},{"C":"c","Collection":"entriess","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"messagess","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"likedMessagess","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"c"},"Collection":"commentss","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"entriess","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"messagess","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"likedMessagess","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}}] =====query subject_class("Todo", C), instance(C, "literal://string:get%20proxy%20test"). =====result -[{"C":"c"}] +[{"bindings":{"C":{"atom":"c"}}}] =====query subject_class("Todo", C), instance(C, "literal://string:get%20proxy%20test"). =====result -[{"C":"c"}] +[{"bindings":{"C":{"atom":"c"}}}] =====query subject_class("Todo", C), property(C, Property). =====result -[{"C":"c","Property":"state"},{"C":"c","Property":"title"},{"C":"c","Property":"isLiked"}] +[{"bindings":{"C":{"atom":"c"},"Property":"state"}},{"bindings":{"C":{"atom":"c"},"Property":"title"}},{"bindings":{"C":{"atom":"c"},"Property":"isLiked"}}] =====query subject_class("Todo", C), property_resolve(C, "state"). =====result @@ -482,7 +479,7 @@ false =====query subject_class("Todo", C), property_resolve(C, "title"). =====result -[{"C":"c"}] +[{"bindings":{"C":{"atom":"c"}}}] =====query subject_class("Todo", C), property_resolve(C, "isLiked"). =====result @@ -490,7 +487,7 @@ false =====query subject_class("Todo", C), property_setter(C, Property, Setter). =====result -[{"C":"c","Property":"state","Setter":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://state\", target: \"value\"}]"},{"C":"c","Property":"title","Setter":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://has_title\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"c"},"Property":"state","Setter":{"atom":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://state\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Property":"title","Setter":{"atom":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://has_title\", target: \"value\"}]"}}}] =====query subject_class("Todo", C), property_resolve_language(C, "state", Language). =====result @@ -498,27 +495,27 @@ false =====query subject_class("Todo", C), property_resolve_language(C, "title", Language). =====result -[{"C":"c","Language":"literal"}] +[{"bindings":{"C":{"atom":"c"},"Language":"literal"}}] =====query subject_class("Todo", C), collection(C, Collection). =====result -[{"C":"c","Collection":"comments"},{"C":"c","Collection":"entries"},{"C":"c","Collection":"messages"},{"C":"c","Collection":"likedMessages"}] +[{"bindings":{"C":{"atom":"c"},"Collection":"comments"}},{"bindings":{"C":{"atom":"c"},"Collection":"entries"}},{"bindings":{"C":{"atom":"c"},"Collection":"messages"}},{"bindings":{"C":{"atom":"c"},"Collection":"likedMessages"}}] =====query subject_class("Todo", C), collection_adder(C, Collection, Adder). =====result -[{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]","C":"c","Collection":"commentss"},{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]","C":"c","Collection":"entriess"},{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]","C":"c","Collection":"messagess"},{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]","C":"c","Collection":"likedMessagess"}] +[{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"commentss"}},{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"entriess"}},{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"messagess"}},{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"likedMessagess"}}] =====query subject_class("Todo", C), collection_remover(C, Collection, Remover). =====result -[{"C":"c","Collection":"commentss","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"},{"C":"c","Collection":"entriess","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"messagess","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"likedMessagess","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"c"},"Collection":"commentss","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"entriess","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"messagess","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"likedMessagess","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}}] =====query subject_class("Todo", C), collection_setter(C, Collection, Setter). =====result -[{"C":"c","Collection":"commentss","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"},{"C":"c","Collection":"entriess","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"messagess","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"likedMessagess","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"c"},"Collection":"commentss","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"entriess","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"messagess","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"likedMessagess","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}}] =====query subject_class("Todo", C), property_getter(C, "literal://string:get%20proxy%20test", "state", Value). =====result -[{"C":"c","Value":"todo://ready"}] +[{"bindings":{"C":{"atom":"c"},"Value":"todo://ready"}}] =====query subject_class("Todo", C), property_getter(C, "literal://string:get%20proxy%20test", "title", Value). =====result @@ -526,7 +523,7 @@ false =====query subject_class("Todo", C), constructor(C, Actions). =====result -[{"Actions":"[{action: \"addLink\", source: \"this\", predicate: \"todo://state\", target: \"todo://ready\"}]","C":"c"}] +[{"bindings":{"Actions":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"todo://state\", target: \"todo://ready\"}]"},"C":{"atom":"c"}}}] =====consult :- discontiguous(triple/3). :- discontiguous(link/5). @@ -648,19 +645,18 @@ collection_getter(c, Base, "likedMessages", List) :- setof(Target, (triple(Base, collection_adder(c, "likedMessagess", '[{action: "addLink", source: "this", predicate: "flux://entry_type", target: "value"}]'). collection_remover(c, "likedMessagess", '[{action: "removeLink", source: "this", predicate: "flux://entry_type", target: "value"}]'). collection_setter(c, "likedMessagess", '[{action: "collectionSetter", source: "this", predicate: "flux://entry_type", target: "value"}]'). - =====query subject_class("Todo", C), instance(C, "literal://string:construct%20test"). =====result -[{"C":"c"},{"C":"c"}] +[{"bindings":{"C":{"atom":"c"}}},{"bindings":{"C":{"atom":"c"}}}] =====query subject_class("Todo", C), instance(C, "literal://string:construct%20test"). =====result -[{"C":"c"},{"C":"c"}] +[{"bindings":{"C":{"atom":"c"}}},{"bindings":{"C":{"atom":"c"}}}] =====query subject_class("Todo", C), property(C, Property). =====result -[{"C":"c","Property":"state"},{"C":"c","Property":"title"},{"C":"c","Property":"isLiked"}] +[{"bindings":{"C":{"atom":"c"},"Property":"state"}},{"bindings":{"C":{"atom":"c"},"Property":"title"}},{"bindings":{"C":{"atom":"c"},"Property":"isLiked"}}] =====query subject_class("Todo", C), property_resolve(C, "state"). =====result @@ -668,7 +664,7 @@ false =====query subject_class("Todo", C), property_resolve(C, "title"). =====result -[{"C":"c"}] +[{"bindings":{"C":{"atom":"c"}}}] =====query subject_class("Todo", C), property_resolve(C, "isLiked"). =====result @@ -676,7 +672,7 @@ false =====query subject_class("Todo", C), property_setter(C, Property, Setter). =====result -[{"C":"c","Property":"state","Setter":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://state\", target: \"value\"}]"},{"C":"c","Property":"title","Setter":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://has_title\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"c"},"Property":"state","Setter":{"atom":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://state\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Property":"title","Setter":{"atom":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://has_title\", target: \"value\"}]"}}}] =====query subject_class("Todo", C), property_resolve_language(C, "state", Language). =====result @@ -684,27 +680,27 @@ false =====query subject_class("Todo", C), property_resolve_language(C, "title", Language). =====result -[{"C":"c","Language":"literal"}] +[{"bindings":{"C":{"atom":"c"},"Language":"literal"}}] =====query subject_class("Todo", C), collection(C, Collection). =====result -[{"C":"c","Collection":"comments"},{"C":"c","Collection":"entries"},{"C":"c","Collection":"messages"},{"C":"c","Collection":"likedMessages"}] +[{"bindings":{"C":{"atom":"c"},"Collection":"comments"}},{"bindings":{"C":{"atom":"c"},"Collection":"entries"}},{"bindings":{"C":{"atom":"c"},"Collection":"messages"}},{"bindings":{"C":{"atom":"c"},"Collection":"likedMessages"}}] =====query subject_class("Todo", C), collection_adder(C, Collection, Adder). =====result -[{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]","C":"c","Collection":"commentss"},{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]","C":"c","Collection":"entriess"},{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]","C":"c","Collection":"messagess"},{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]","C":"c","Collection":"likedMessagess"}] +[{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"commentss"}},{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"entriess"}},{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"messagess"}},{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"likedMessagess"}}] =====query subject_class("Todo", C), collection_remover(C, Collection, Remover). =====result -[{"C":"c","Collection":"commentss","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"},{"C":"c","Collection":"entriess","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"messagess","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"likedMessagess","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"c"},"Collection":"commentss","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"entriess","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"messagess","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"likedMessagess","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}}] =====query subject_class("Todo", C), collection_setter(C, Collection, Setter). =====result -[{"C":"c","Collection":"commentss","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"},{"C":"c","Collection":"entriess","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"messagess","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"likedMessagess","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"c"},"Collection":"commentss","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"entriess","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"messagess","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"likedMessagess","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}}] =====query subject_class("Todo", C), property_getter(C, "literal://string:construct%20test", "state", Value). =====result -[{"C":"c","Value":"todo://ready"},{"C":"c","Value":"todo://ready"}] +[{"bindings":{"C":{"atom":"c"},"Value":"todo://ready"}},{"bindings":{"C":{"atom":"c"},"Value":"todo://ready"}}] =====consult :- discontiguous(triple/3). :- discontiguous(link/5). @@ -824,11 +820,10 @@ collection_getter(c, Base, "likedMessages", List) :- setof(Target, (triple(Base, collection_adder(c, "likedMessagess", '[{action: "addLink", source: "this", predicate: "flux://entry_type", target: "value"}]'). collection_remover(c, "likedMessagess", '[{action: "removeLink", source: "this", predicate: "flux://entry_type", target: "value"}]'). collection_setter(c, "likedMessagess", '[{action: "collectionSetter", source: "this", predicate: "flux://entry_type", target: "value"}]'). - =====query subject_class("Todo", C), property_getter(C, "literal://string:construct%20test", "state", Value). =====result -[{"C":"c","Value":"todo://done"}] +[{"bindings":{"C":{"atom":"c"},"Value":"todo://done"}}] =====query subject_class("Todo", C), property_getter(C, "literal://string:construct%20test", "title", Value). =====result @@ -957,19 +952,18 @@ collection_getter(c, Base, "likedMessages", List) :- setof(Target, (triple(Base, collection_adder(c, "likedMessagess", '[{action: "addLink", source: "this", predicate: "flux://entry_type", target: "value"}]'). collection_remover(c, "likedMessagess", '[{action: "removeLink", source: "this", predicate: "flux://entry_type", target: "value"}]'). collection_setter(c, "likedMessagess", '[{action: "collectionSetter", source: "this", predicate: "flux://entry_type", target: "value"}]'). - =====query subject_class("Todo", C), property_getter(C, "literal://string:construct%20test", "title", Value). =====result -[{"C":"c","Value":"literal://json:%7B%22author%22%3A%22did%3Akey%3Az6MkfCr9Wg3J5EdakDEJQM3VdSRn6nDTSwtEd1AC8V7E4Qpp%22%2C%22timestamp%22%3A%222024-02-01T12%3A28%3A47.641Z%22%2C%22data%22%3A%22test%20title%22%2C%22proof%22%3A%7B%22key%22%3A%22did%3Akey%3Az6MkfCr9Wg3J5EdakDEJQM3VdSRn6nDTSwtEd1AC8V7E4Qpp%23z6MkfCr9Wg3J5EdakDEJQM3VdSRn6nDTSwtEd1AC8V7E4Qpp%22%2C%22signature%22%3A%2210841c13759dcf7f36f291d3231782cfcb6455cb977ad59fc99301569f454924b03400167835f5ad5dc39ff64e193648b88645b965525f0fb66aaa73572ba602%22%2C%22valid%22%3Atrue%2C%22invalid%22%3Afalse%7D%7D"}] +[{"bindings":{"C":{"atom":"c"},"Value":"literal://json:%7B%22author%22%3A%22did%3Akey%3Az6MkfCr9Wg3J5EdakDEJQM3VdSRn6nDTSwtEd1AC8V7E4Qpp%22%2C%22timestamp%22%3A%222024-02-01T12%3A28%3A47.641Z%22%2C%22data%22%3A%22test%20title%22%2C%22proof%22%3A%7B%22key%22%3A%22did%3Akey%3Az6MkfCr9Wg3J5EdakDEJQM3VdSRn6nDTSwtEd1AC8V7E4Qpp%23z6MkfCr9Wg3J5EdakDEJQM3VdSRn6nDTSwtEd1AC8V7E4Qpp%22%2C%22signature%22%3A%2210841c13759dcf7f36f291d3231782cfcb6455cb977ad59fc99301569f454924b03400167835f5ad5dc39ff64e193648b88645b965525f0fb66aaa73572ba602%22%2C%22valid%22%3Atrue%2C%22invalid%22%3Afalse%7D%7D"}}] =====query subject_class("Todo", C), collection_getter(C, "literal://string:construct%20test", "comments", Value). =====result -[{"C":"c","Value":[""]}] +[{"bindings":{"C":{"atom":"c"},"Value":[]}}] =====query subject_class("Todo", C), collection_getter(C, "literal://string:construct%20test", "comments", Value). =====result -[{"C":"c","Value":[""]}] +[{"bindings":{"C":{"atom":"c"},"Value":[]}}] =====consult :- discontiguous(triple/3). :- discontiguous(link/5). @@ -1099,11 +1093,10 @@ collection_getter(c, Base, "likedMessages", List) :- setof(Target, (triple(Base, collection_adder(c, "likedMessagess", '[{action: "addLink", source: "this", predicate: "flux://entry_type", target: "value"}]'). collection_remover(c, "likedMessagess", '[{action: "removeLink", source: "this", predicate: "flux://entry_type", target: "value"}]'). collection_setter(c, "likedMessagess", '[{action: "collectionSetter", source: "this", predicate: "flux://entry_type", target: "value"}]'). - =====query subject_class("Todo", C), collection_getter(C, "literal://string:construct%20test", "comments", Value). =====result -[{"C":"c","Value":["literal://string:comment%201"]}] +[{"bindings":{"C":{"atom":"c"},"Value":["literal://string:comment%201"]}}] =====consult :- discontiguous(triple/3). :- discontiguous(link/5). @@ -1238,11 +1231,10 @@ collection_getter(c, Base, "likedMessages", List) :- setof(Target, (triple(Base, collection_adder(c, "likedMessagess", '[{action: "addLink", source: "this", predicate: "flux://entry_type", target: "value"}]'). collection_remover(c, "likedMessagess", '[{action: "removeLink", source: "this", predicate: "flux://entry_type", target: "value"}]'). collection_setter(c, "likedMessagess", '[{action: "collectionSetter", source: "this", predicate: "flux://entry_type", target: "value"}]'). - =====query subject_class("Todo", C), collection_getter(C, "literal://string:construct%20test", "comments", Value). =====result -[{"C":"c","Value":["literal://string:comment%201","literal://string:comment%202"]}] +[{"bindings":{"C":{"atom":"c"},"Value":["literal://string:comment%201","literal://string:comment%202"]}}] =====consult :- discontiguous(triple/3). :- discontiguous(link/5). @@ -1367,11 +1359,10 @@ collection_getter(c, Base, "likedMessages", List) :- setof(Target, (triple(Base, collection_adder(c, "likedMessagess", '[{action: "addLink", source: "this", predicate: "flux://entry_type", target: "value"}]'). collection_remover(c, "likedMessagess", '[{action: "removeLink", source: "this", predicate: "flux://entry_type", target: "value"}]'). collection_setter(c, "likedMessagess", '[{action: "collectionSetter", source: "this", predicate: "flux://entry_type", target: "value"}]'). - =====query subject_class("Todo", C), collection_getter(C, "literal://string:construct%20test", "comments", Value). =====result -[{"C":"c","Value":[""]}] +[{"bindings":{"C":{"atom":"c"},"Value":[]}}] =====consult :- discontiguous(triple/3). :- discontiguous(link/5). @@ -1501,11 +1492,10 @@ collection_getter(c, Base, "likedMessages", List) :- setof(Target, (triple(Base, collection_adder(c, "likedMessagess", '[{action: "addLink", source: "this", predicate: "flux://entry_type", target: "value"}]'). collection_remover(c, "likedMessagess", '[{action: "removeLink", source: "this", predicate: "flux://entry_type", target: "value"}]'). collection_setter(c, "likedMessagess", '[{action: "collectionSetter", source: "this", predicate: "flux://entry_type", target: "value"}]'). - =====query subject_class("Todo", C), collection_getter(C, "literal://string:construct%20test", "comments", Value). =====result -[{"C":"c","Value":["literal://string:new%20comment%201"]}] +[{"bindings":{"C":{"atom":"c"},"Value":["literal://string:new%20comment%201"]}}] =====consult :- discontiguous(triple/3). :- discontiguous(link/5). @@ -1640,35 +1630,34 @@ collection_getter(c, Base, "likedMessages", List) :- setof(Target, (triple(Base, collection_adder(c, "likedMessagess", '[{action: "addLink", source: "this", predicate: "flux://entry_type", target: "value"}]'). collection_remover(c, "likedMessagess", '[{action: "removeLink", source: "this", predicate: "flux://entry_type", target: "value"}]'). collection_setter(c, "likedMessagess", '[{action: "collectionSetter", source: "this", predicate: "flux://entry_type", target: "value"}]'). - =====query subject_class("Todo", C), collection_getter(C, "literal://string:construct%20test", "comments", Value). =====result -[{"C":"c","Value":["literal://string:new%20comment%201","literal://string:new%20comment%202"]}] +[{"bindings":{"C":{"atom":"c"},"Value":["literal://string:new%20comment%201","literal://string:new%20comment%202"]}}] =====query subject_class("Todo", C), instance(C, X). =====result -[{"C":"c","X":"literal://string:get%20proxy%20test"},{"C":"c","X":"literal://string:construct%20test"}] +[{"bindings":{"C":{"atom":"c"},"X":"literal://string:get%20proxy%20test"}},{"bindings":{"C":{"atom":"c"},"X":"literal://string:construct%20test"}}] =====query subject_class("Todo", C), instance(C, "literal://string:get%20proxy%20test"). =====query subject_class("Todo", C), instance(C, "literal://string:construct%20test"). =====result -[{"C":"c"}] +[{"bindings":{"C":{"atom":"c"}}}] =====result -[{"C":"c"}] +[{"bindings":{"C":{"atom":"c"}}}] =====query subject_class("Todo", C), instance(C, "literal://string:construct%20test"). =====query subject_class("Todo", C), instance(C, "literal://string:get%20proxy%20test"). =====result -[{"C":"c"}] +[{"bindings":{"C":{"atom":"c"}}}] =====result -[{"C":"c"}] +[{"bindings":{"C":{"atom":"c"}}}] =====query subject_class("Todo", C), property(C, Property). =====result -[{"C":"c","Property":"state"},{"C":"c","Property":"title"},{"C":"c","Property":"isLiked"}] +[{"bindings":{"C":{"atom":"c"},"Property":"state"}},{"bindings":{"C":{"atom":"c"},"Property":"title"}},{"bindings":{"C":{"atom":"c"},"Property":"isLiked"}}] =====query subject_class("Todo", C), property_resolve(C, "state"). =====result @@ -1676,7 +1665,7 @@ false =====query subject_class("Todo", C), property_resolve(C, "title"). =====result -[{"C":"c"}] +[{"bindings":{"C":{"atom":"c"}}}] =====query subject_class("Todo", C), property_resolve(C, "isLiked"). =====result @@ -1684,7 +1673,7 @@ false =====query subject_class("Todo", C), property_setter(C, Property, Setter). =====result -[{"C":"c","Property":"state","Setter":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://state\", target: \"value\"}]"},{"C":"c","Property":"title","Setter":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://has_title\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"c"},"Property":"state","Setter":{"atom":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://state\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Property":"title","Setter":{"atom":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://has_title\", target: \"value\"}]"}}}] =====query subject_class("Todo", C), property_resolve_language(C, "state", Language). =====result @@ -1692,31 +1681,31 @@ false =====query subject_class("Todo", C), property_resolve_language(C, "title", Language). =====result -[{"C":"c","Language":"literal"}] +[{"bindings":{"C":{"atom":"c"},"Language":"literal"}}] =====query subject_class("Todo", C), collection(C, Collection). =====result -[{"C":"c","Collection":"comments"},{"C":"c","Collection":"entries"},{"C":"c","Collection":"messages"},{"C":"c","Collection":"likedMessages"}] +[{"bindings":{"C":{"atom":"c"},"Collection":"comments"}},{"bindings":{"C":{"atom":"c"},"Collection":"entries"}},{"bindings":{"C":{"atom":"c"},"Collection":"messages"}},{"bindings":{"C":{"atom":"c"},"Collection":"likedMessages"}}] =====query subject_class("Todo", C), collection_adder(C, Collection, Adder). =====result -[{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]","C":"c","Collection":"commentss"},{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]","C":"c","Collection":"entriess"},{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]","C":"c","Collection":"messagess"},{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]","C":"c","Collection":"likedMessagess"}] +[{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"commentss"}},{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"entriess"}},{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"messagess"}},{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"likedMessagess"}}] =====query subject_class("Todo", C), collection_remover(C, Collection, Remover). =====result -[{"C":"c","Collection":"commentss","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"},{"C":"c","Collection":"entriess","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"messagess","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"likedMessagess","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"c"},"Collection":"commentss","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"entriess","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"messagess","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"likedMessagess","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}}] =====query subject_class("Todo", C), collection_setter(C, Collection, Setter). =====result -[{"C":"c","Collection":"commentss","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"},{"C":"c","Collection":"entriess","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"messagess","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"likedMessagess","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"c"},"Collection":"commentss","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"entriess","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"messagess","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"likedMessagess","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}}] =====query subject_class("Todo", C), property_getter(C, "literal://string:construct%20test", "state", Value). =====result -[{"C":"c","Value":"todo://done"}] +[{"bindings":{"C":{"atom":"c"},"Value":"todo://done"}}] =====query subject_class(Class, C), property(C, "state"), property(C, "title"), collection(C, "comments"), property_setter(C, "state", _), property_setter(C, "title", _), collection_adder(C, "commentss", _), collection_setter(C, "commentss", _). =====result -[{"C":"c","Class":"Todo"}] +[{"bindings":{"C":{"atom":"c"},"Class":"Todo"}}] =====query subject_class(Class, C), property(C, "name"), property(C, "x"), property_setter(C, "top", _). =====result @@ -1728,31 +1717,31 @@ false =====query subject_class(Class, C), property(C, "state"), property(C, "title"), collection(C, "comments"), property_setter(C, "state", _), property_setter(C, "title", _), collection_adder(C, "commentss", _), collection_setter(C, "commentss", _). =====result -[{"C":"c","Class":"Todo"}] +[{"bindings":{"C":{"atom":"c"},"Class":"Todo"}}] =====query subject_class("Todo", C), instance(C, X). =====result -[{"C":"c","X":"literal://string:get%20proxy%20test"},{"C":"c","X":"literal://string:construct%20test"}] +[{"bindings":{"C":{"atom":"c"},"X":"literal://string:get%20proxy%20test"}},{"bindings":{"C":{"atom":"c"},"X":"literal://string:construct%20test"}}] =====query subject_class("Todo", C), instance(C, "literal://string:get%20proxy%20test"). =====query subject_class("Todo", C), instance(C, "literal://string:construct%20test"). =====result -[{"C":"c"}] +[{"bindings":{"C":{"atom":"c"}}}] =====result -[{"C":"c"}] +[{"bindings":{"C":{"atom":"c"}}}] =====query subject_class("Todo", C), instance(C, "literal://string:construct%20test"). =====query subject_class("Todo", C), instance(C, "literal://string:get%20proxy%20test"). =====result -[{"C":"c"}] +[{"bindings":{"C":{"atom":"c"}}}] =====result -[{"C":"c"}] +[{"bindings":{"C":{"atom":"c"}}}] =====query subject_class("Todo", C), property(C, Property). =====result -[{"C":"c","Property":"state"},{"C":"c","Property":"title"},{"C":"c","Property":"isLiked"}] +[{"bindings":{"C":{"atom":"c"},"Property":"state"}},{"bindings":{"C":{"atom":"c"},"Property":"title"}},{"bindings":{"C":{"atom":"c"},"Property":"isLiked"}}] =====query subject_class("Todo", C), property_resolve(C, "state"). =====result @@ -1760,7 +1749,7 @@ false =====query subject_class("Todo", C), property_resolve(C, "title"). =====result -[{"C":"c"}] +[{"bindings":{"C":{"atom":"c"}}}] =====query subject_class("Todo", C), property_resolve(C, "isLiked"). =====result @@ -1768,7 +1757,7 @@ false =====query subject_class("Todo", C), property_setter(C, Property, Setter). =====result -[{"C":"c","Property":"state","Setter":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://state\", target: \"value\"}]"},{"C":"c","Property":"title","Setter":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://has_title\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"c"},"Property":"state","Setter":{"atom":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://state\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Property":"title","Setter":{"atom":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://has_title\", target: \"value\"}]"}}}] =====query subject_class("Todo", C), property_resolve_language(C, "state", Language). =====result @@ -1776,35 +1765,35 @@ false =====query subject_class("Todo", C), property_resolve_language(C, "title", Language). =====result -[{"C":"c","Language":"literal"}] +[{"bindings":{"C":{"atom":"c"},"Language":"literal"}}] =====query subject_class("Todo", C), collection(C, Collection). =====result -[{"C":"c","Collection":"comments"},{"C":"c","Collection":"entries"},{"C":"c","Collection":"messages"},{"C":"c","Collection":"likedMessages"}] +[{"bindings":{"C":{"atom":"c"},"Collection":"comments"}},{"bindings":{"C":{"atom":"c"},"Collection":"entries"}},{"bindings":{"C":{"atom":"c"},"Collection":"messages"}},{"bindings":{"C":{"atom":"c"},"Collection":"likedMessages"}}] =====query subject_class("Todo", C), collection_adder(C, Collection, Adder). =====result -[{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]","C":"c","Collection":"commentss"},{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]","C":"c","Collection":"entriess"},{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]","C":"c","Collection":"messagess"},{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]","C":"c","Collection":"likedMessagess"}] +[{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"commentss"}},{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"entriess"}},{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"messagess"}},{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"likedMessagess"}}] =====query subject_class("Todo", C), collection_remover(C, Collection, Remover). =====result -[{"C":"c","Collection":"commentss","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"},{"C":"c","Collection":"entriess","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"messagess","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"likedMessagess","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"c"},"Collection":"commentss","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"entriess","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"messagess","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"likedMessagess","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}}] =====query subject_class("Todo", C), collection_setter(C, Collection, Setter). =====result -[{"C":"c","Collection":"commentss","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"},{"C":"c","Collection":"entriess","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"messagess","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"likedMessagess","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"c"},"Collection":"commentss","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"entriess","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"messagess","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"likedMessagess","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}}] =====query subject_class("Todo", C), property_getter(C, "literal://string:construct%20test", "state", Value). =====result -[{"C":"c","Value":"todo://done"}] +[{"bindings":{"C":{"atom":"c"},"Value":"todo://done"}}] =====query subject_class(Class, C), property(C, "state"), property(C, "title"), property(C, "isLiked"), property_setter(C, "state", _), property_setter(C, "title", _), collection_adder(C, "commentss", _), collection_adder(C, "entriess", _), collection_adder(C, "messagess", _), collection_adder(C, "likedMessagess", _), collection_remover(C, "commentss", _), collection_remover(C, "entriess", _), collection_remover(C, "messagess", _), collection_remover(C, "likedMessagess", _), collection_setter(C, "commentss", _), collection_setter(C, "entriess", _), collection_setter(C, "messagess", _), collection_setter(C, "likedMessagess", _). =====result -[{"C":"c","Class":"Todo"}] +[{"bindings":{"C":{"atom":"c"},"Class":"Todo"}}] =====query subject_class("Todo", C), constructor(C, Actions). =====result -[{"Actions":"[{action: \"addLink\", source: \"this\", predicate: \"todo://state\", target: \"todo://ready\"}]","C":"c"}] +[{"bindings":{"Actions":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"todo://state\", target: \"todo://ready\"}]"},"C":{"atom":"c"}}}] =====consult :- discontiguous(triple/3). :- discontiguous(link/5). @@ -1944,27 +1933,26 @@ collection_getter(c, Base, "likedMessages", List) :- setof(Target, (triple(Base, collection_adder(c, "likedMessagess", '[{action: "addLink", source: "this", predicate: "flux://entry_type", target: "value"}]'). collection_remover(c, "likedMessagess", '[{action: "removeLink", source: "this", predicate: "flux://entry_type", target: "value"}]'). collection_setter(c, "likedMessagess", '[{action: "collectionSetter", source: "this", predicate: "flux://entry_type", target: "value"}]'). - =====query subject_class(Class, C), property(C, "state"), property(C, "title"), property(C, "isLiked"), property_setter(C, "state", _), property_setter(C, "title", _), collection_adder(C, "commentss", _), collection_adder(C, "entriess", _), collection_adder(C, "messagess", _), collection_adder(C, "likedMessagess", _), collection_remover(C, "commentss", _), collection_remover(C, "entriess", _), collection_remover(C, "messagess", _), collection_remover(C, "likedMessagess", _), collection_setter(C, "commentss", _), collection_setter(C, "entriess", _), collection_setter(C, "messagess", _), collection_setter(C, "likedMessagess", _). =====result -[{"C":"c","Class":"Todo"}] +[{"bindings":{"C":{"atom":"c"},"Class":"Todo"}}] =====query subject_class("Todo", C), instance(C, "literal://string:Decorated%20class%20construction%20test"). =====result -[{"C":"c"}] +[{"bindings":{"C":{"atom":"c"}}}] =====query subject_class(Class, C), property(C, "state"), property(C, "title"), property(C, "isLiked"), property_setter(C, "state", _), property_setter(C, "title", _), collection_adder(C, "commentss", _), collection_adder(C, "entriess", _), collection_adder(C, "messagess", _), collection_adder(C, "likedMessagess", _), collection_remover(C, "commentss", _), collection_remover(C, "entriess", _), collection_remover(C, "messagess", _), collection_remover(C, "likedMessagess", _), collection_setter(C, "commentss", _), collection_setter(C, "entriess", _), collection_setter(C, "messagess", _), collection_setter(C, "likedMessagess", _). =====result -[{"C":"c","Class":"Todo"}] +[{"bindings":{"C":{"atom":"c"},"Class":"Todo"}}] =====query subject_class("Todo", C), instance(C, "literal://string:Decorated%20class%20construction%20test"). =====result -[{"C":"c"}] +[{"bindings":{"C":{"atom":"c"}}}] =====query subject_class("Todo", C), property(C, Property). =====result -[{"C":"c","Property":"state"},{"C":"c","Property":"title"},{"C":"c","Property":"isLiked"}] +[{"bindings":{"C":{"atom":"c"},"Property":"state"}},{"bindings":{"C":{"atom":"c"},"Property":"title"}},{"bindings":{"C":{"atom":"c"},"Property":"isLiked"}}] =====query subject_class("Todo", C), property_resolve(C, "state"). =====result @@ -1972,7 +1960,7 @@ false =====query subject_class("Todo", C), property_resolve(C, "title"). =====result -[{"C":"c"}] +[{"bindings":{"C":{"atom":"c"}}}] =====query subject_class("Todo", C), property_resolve(C, "isLiked"). =====result @@ -1980,7 +1968,7 @@ false =====query subject_class("Todo", C), property_setter(C, Property, Setter). =====result -[{"C":"c","Property":"state","Setter":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://state\", target: \"value\"}]"},{"C":"c","Property":"title","Setter":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://has_title\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"c"},"Property":"state","Setter":{"atom":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://state\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Property":"title","Setter":{"atom":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://has_title\", target: \"value\"}]"}}}] =====query subject_class("Todo", C), property_resolve_language(C, "state", Language). =====result @@ -1988,51 +1976,51 @@ false =====query subject_class("Todo", C), property_resolve_language(C, "title", Language). =====result -[{"C":"c","Language":"literal"}] +[{"bindings":{"C":{"atom":"c"},"Language":"literal"}}] =====query subject_class("Todo", C), collection(C, Collection). =====result -[{"C":"c","Collection":"comments"},{"C":"c","Collection":"entries"},{"C":"c","Collection":"messages"},{"C":"c","Collection":"likedMessages"}] +[{"bindings":{"C":{"atom":"c"},"Collection":"comments"}},{"bindings":{"C":{"atom":"c"},"Collection":"entries"}},{"bindings":{"C":{"atom":"c"},"Collection":"messages"}},{"bindings":{"C":{"atom":"c"},"Collection":"likedMessages"}}] =====query subject_class("Todo", C), collection_adder(C, Collection, Adder). =====result -[{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]","C":"c","Collection":"commentss"},{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]","C":"c","Collection":"entriess"},{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]","C":"c","Collection":"messagess"},{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]","C":"c","Collection":"likedMessagess"}] +[{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"commentss"}},{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"entriess"}},{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"messagess"}},{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"likedMessagess"}}] =====query subject_class("Todo", C), collection_remover(C, Collection, Remover). =====result -[{"C":"c","Collection":"commentss","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"},{"C":"c","Collection":"entriess","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"messagess","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"likedMessagess","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"c"},"Collection":"commentss","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"entriess","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"messagess","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"likedMessagess","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}}] =====query subject_class("Todo", C), collection_setter(C, Collection, Setter). =====result -[{"C":"c","Collection":"commentss","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"},{"C":"c","Collection":"entriess","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"messagess","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"likedMessagess","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"c"},"Collection":"commentss","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"entriess","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"messagess","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"likedMessagess","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}}] =====query subject_class(Class, C), property(C, "state"), property(C, "title"), property(C, "isLiked"), property_setter(C, "state", _), property_setter(C, "title", _), collection_adder(C, "commentss", _), collection_adder(C, "entriess", _), collection_adder(C, "messagess", _), collection_adder(C, "likedMessagess", _), collection_remover(C, "commentss", _), collection_remover(C, "entriess", _), collection_remover(C, "messagess", _), collection_remover(C, "likedMessagess", _), collection_setter(C, "commentss", _), collection_setter(C, "entriess", _), collection_setter(C, "messagess", _), collection_setter(C, "likedMessagess", _). =====result -[{"C":"c","Class":"Todo"}] +[{"bindings":{"C":{"atom":"c"},"Class":"Todo"}}] =====query subject_class("Todo", C), instance(C, "literal://string:Decorated%20class%20construction%20test"). =====result -[{"C":"c"}] +[{"bindings":{"C":{"atom":"c"}}}] =====query subject_class(Class, C), property(C, "state"), property(C, "title"), property(C, "isLiked"), property_setter(C, "state", _), property_setter(C, "title", _), collection_adder(C, "commentss", _), collection_adder(C, "entriess", _), collection_adder(C, "messagess", _), collection_adder(C, "likedMessagess", _), collection_remover(C, "commentss", _), collection_remover(C, "entriess", _), collection_remover(C, "messagess", _), collection_remover(C, "likedMessagess", _), collection_setter(C, "commentss", _), collection_setter(C, "entriess", _), collection_setter(C, "messagess", _), collection_setter(C, "likedMessagess", _). =====result -[{"C":"c","Class":"Todo"}] +[{"bindings":{"C":{"atom":"c"},"Class":"Todo"}}] =====query subject_class("Todo", C), instance(C, "literal://string:Decorated%20class%20construction%20test"). =====result -[{"C":"c"}] +[{"bindings":{"C":{"atom":"c"}}}] =====query subject_class(Class, C), property(C, "state"), property(C, "title"), property(C, "isLiked"), property_setter(C, "state", _), property_setter(C, "title", _), collection_adder(C, "commentss", _), collection_adder(C, "entriess", _), collection_adder(C, "messagess", _), collection_adder(C, "likedMessagess", _), collection_remover(C, "commentss", _), collection_remover(C, "entriess", _), collection_remover(C, "messagess", _), collection_remover(C, "likedMessagess", _), collection_setter(C, "commentss", _), collection_setter(C, "entriess", _), collection_setter(C, "messagess", _), collection_setter(C, "likedMessagess", _). =====result -[{"C":"c","Class":"Todo"}] +[{"bindings":{"C":{"atom":"c"},"Class":"Todo"}}] =====query subject_class("Todo", C), instance(C, "literal://string:Decorated%20class%20construction%20test"). =====result -[{"C":"c"}] +[{"bindings":{"C":{"atom":"c"}}}] =====query subject_class("Todo", C), property(C, Property). =====result -[{"C":"c","Property":"state"},{"C":"c","Property":"title"},{"C":"c","Property":"isLiked"}] +[{"bindings":{"C":{"atom":"c"},"Property":"state"}},{"bindings":{"C":{"atom":"c"},"Property":"title"}},{"bindings":{"C":{"atom":"c"},"Property":"isLiked"}}] =====query subject_class("Todo", C), property_resolve(C, "state"). =====result @@ -2040,7 +2028,7 @@ false =====query subject_class("Todo", C), property_resolve(C, "title"). =====result -[{"C":"c"}] +[{"bindings":{"C":{"atom":"c"}}}] =====query subject_class("Todo", C), property_resolve(C, "isLiked"). =====result @@ -2048,7 +2036,7 @@ false =====query subject_class("Todo", C), property_setter(C, Property, Setter). =====result -[{"C":"c","Property":"state","Setter":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://state\", target: \"value\"}]"},{"C":"c","Property":"title","Setter":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://has_title\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"c"},"Property":"state","Setter":{"atom":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://state\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Property":"title","Setter":{"atom":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://has_title\", target: \"value\"}]"}}}] =====query subject_class("Todo", C), property_resolve_language(C, "state", Language). =====result @@ -2056,27 +2044,27 @@ false =====query subject_class("Todo", C), property_resolve_language(C, "title", Language). =====result -[{"C":"c","Language":"literal"}] +[{"bindings":{"C":{"atom":"c"},"Language":"literal"}}] =====query subject_class("Todo", C), collection(C, Collection). =====result -[{"C":"c","Collection":"comments"},{"C":"c","Collection":"entries"},{"C":"c","Collection":"messages"},{"C":"c","Collection":"likedMessages"}] +[{"bindings":{"C":{"atom":"c"},"Collection":"comments"}},{"bindings":{"C":{"atom":"c"},"Collection":"entries"}},{"bindings":{"C":{"atom":"c"},"Collection":"messages"}},{"bindings":{"C":{"atom":"c"},"Collection":"likedMessages"}}] =====query subject_class("Todo", C), collection_adder(C, Collection, Adder). =====result -[{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]","C":"c","Collection":"commentss"},{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]","C":"c","Collection":"entriess"},{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]","C":"c","Collection":"messagess"},{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]","C":"c","Collection":"likedMessagess"}] +[{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"commentss"}},{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"entriess"}},{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"messagess"}},{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"likedMessagess"}}] =====query subject_class("Todo", C), collection_remover(C, Collection, Remover). =====result -[{"C":"c","Collection":"commentss","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"},{"C":"c","Collection":"entriess","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"messagess","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"likedMessagess","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"c"},"Collection":"commentss","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"entriess","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"messagess","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"likedMessagess","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}}] =====query subject_class("Todo", C), collection_setter(C, Collection, Setter). =====result -[{"C":"c","Collection":"commentss","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"},{"C":"c","Collection":"entriess","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"messagess","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"likedMessagess","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"c"},"Collection":"commentss","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"entriess","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"messagess","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"likedMessagess","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}}] =====query subject_class("Todo", C), property_getter(C, "literal://string:Decorated%20class%20construction%20test", "state", Value). =====result -[{"C":"c","Value":"todo://ready"}] +[{"bindings":{"C":{"atom":"c"},"Value":"todo://ready"}}] =====query subject_class("Todo", C), property_getter(C, "literal://string:Decorated%20class%20construction%20test", "title", Value). =====result @@ -2084,7 +2072,7 @@ false =====query subject_class("Todo", C), collection_getter(C, "literal://string:Decorated%20class%20construction%20test", "comments", Value). =====result -[{"C":"c","Value":[""]}] +[{"bindings":{"C":{"atom":"c"},"Value":[]}}] =====consult :- discontiguous(triple/3). :- discontiguous(link/5). @@ -2224,15 +2212,14 @@ collection_getter(c, Base, "likedMessages", List) :- setof(Target, (triple(Base, collection_adder(c, "likedMessagess", '[{action: "addLink", source: "this", predicate: "flux://entry_type", target: "value"}]'). collection_remover(c, "likedMessagess", '[{action: "removeLink", source: "this", predicate: "flux://entry_type", target: "value"}]'). collection_setter(c, "likedMessagess", '[{action: "collectionSetter", source: "this", predicate: "flux://entry_type", target: "value"}]'). - =====query subject_class("Todo", C), property_getter(C, "literal://string:Decorated%20class%20construction%20test", "state", Value). =====result -[{"C":"c","Value":"todo://review"}] +[{"bindings":{"C":{"atom":"c"},"Value":"todo://review"}}] =====query subject_class("Todo", C), collection_getter(C, "literal://string:Decorated%20class%20construction%20test", "comments", Value). =====result -[{"C":"c","Value":[""]}] +[{"bindings":{"C":{"atom":"c"},"Value":[]}}] =====consult :- discontiguous(triple/3). :- discontiguous(link/5). @@ -2377,23 +2364,22 @@ collection_getter(c, Base, "likedMessages", List) :- setof(Target, (triple(Base, collection_adder(c, "likedMessagess", '[{action: "addLink", source: "this", predicate: "flux://entry_type", target: "value"}]'). collection_remover(c, "likedMessagess", '[{action: "removeLink", source: "this", predicate: "flux://entry_type", target: "value"}]'). collection_setter(c, "likedMessagess", '[{action: "collectionSetter", source: "this", predicate: "flux://entry_type", target: "value"}]'). - =====query subject_class("Todo", C), collection_getter(C, "literal://string:Decorated%20class%20construction%20test", "comments", Value). =====result -[{"C":"c","Value":["literal://string:new%20comment"]}] +[{"bindings":{"C":{"atom":"c"},"Value":["literal://string:new%20comment"]}}] =====query subject_class("Todo", C), instance(C, Instance). =====result -[{"C":"c","Instance":"literal://string:get%20proxy%20test"},{"C":"c","Instance":"literal://string:construct%20test"},{"C":"c","Instance":"literal://string:Decorated%20class%20construction%20test"}] +[{"bindings":{"C":{"atom":"c"},"Instance":"literal://string:get%20proxy%20test"}},{"bindings":{"C":{"atom":"c"},"Instance":"literal://string:construct%20test"}},{"bindings":{"C":{"atom":"c"},"Instance":"literal://string:Decorated%20class%20construction%20test"}}] =====query subject_class("Todo", C), instance(C, "literal://string:get%20proxy%20test"). =====result -[{"C":"c"}] +[{"bindings":{"C":{"atom":"c"}}}] =====query subject_class("Todo", C), property(C, Property). =====result -[{"C":"c","Property":"state"},{"C":"c","Property":"title"},{"C":"c","Property":"isLiked"}] +[{"bindings":{"C":{"atom":"c"},"Property":"state"}},{"bindings":{"C":{"atom":"c"},"Property":"title"}},{"bindings":{"C":{"atom":"c"},"Property":"isLiked"}}] =====query subject_class("Todo", C), property_resolve(C, "state"). =====result @@ -2401,7 +2387,7 @@ false =====query subject_class("Todo", C), property_resolve(C, "title"). =====result -[{"C":"c"}] +[{"bindings":{"C":{"atom":"c"}}}] =====query subject_class("Todo", C), property_resolve(C, "isLiked"). =====result @@ -2409,7 +2395,7 @@ false =====query subject_class("Todo", C), property_setter(C, Property, Setter). =====result -[{"C":"c","Property":"state","Setter":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://state\", target: \"value\"}]"},{"C":"c","Property":"title","Setter":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://has_title\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"c"},"Property":"state","Setter":{"atom":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://state\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Property":"title","Setter":{"atom":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://has_title\", target: \"value\"}]"}}}] =====query subject_class("Todo", C), property_resolve_language(C, "state", Language). =====result @@ -2417,31 +2403,31 @@ false =====query subject_class("Todo", C), property_resolve_language(C, "title", Language). =====result -[{"C":"c","Language":"literal"}] +[{"bindings":{"C":{"atom":"c"},"Language":"literal"}}] =====query subject_class("Todo", C), collection(C, Collection). =====result -[{"C":"c","Collection":"comments"},{"C":"c","Collection":"entries"},{"C":"c","Collection":"messages"},{"C":"c","Collection":"likedMessages"}] +[{"bindings":{"C":{"atom":"c"},"Collection":"comments"}},{"bindings":{"C":{"atom":"c"},"Collection":"entries"}},{"bindings":{"C":{"atom":"c"},"Collection":"messages"}},{"bindings":{"C":{"atom":"c"},"Collection":"likedMessages"}}] =====query subject_class("Todo", C), collection_adder(C, Collection, Adder). =====result -[{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]","C":"c","Collection":"commentss"},{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]","C":"c","Collection":"entriess"},{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]","C":"c","Collection":"messagess"},{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]","C":"c","Collection":"likedMessagess"}] +[{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"commentss"}},{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"entriess"}},{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"messagess"}},{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"likedMessagess"}}] =====query subject_class("Todo", C), collection_remover(C, Collection, Remover). =====result -[{"C":"c","Collection":"commentss","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"},{"C":"c","Collection":"entriess","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"messagess","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"likedMessagess","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"c"},"Collection":"commentss","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"entriess","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"messagess","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"likedMessagess","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}}] =====query subject_class("Todo", C), collection_setter(C, Collection, Setter). =====result -[{"C":"c","Collection":"commentss","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"},{"C":"c","Collection":"entriess","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"messagess","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"likedMessagess","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"c"},"Collection":"commentss","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"entriess","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"messagess","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"likedMessagess","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}}] =====query subject_class("Todo", C), instance(C, "literal://string:construct%20test"). =====result -[{"C":"c"}] +[{"bindings":{"C":{"atom":"c"}}}] =====query subject_class("Todo", C), property(C, Property). =====result -[{"C":"c","Property":"state"},{"C":"c","Property":"title"},{"C":"c","Property":"isLiked"}] +[{"bindings":{"C":{"atom":"c"},"Property":"state"}},{"bindings":{"C":{"atom":"c"},"Property":"title"}},{"bindings":{"C":{"atom":"c"},"Property":"isLiked"}}] =====query subject_class("Todo", C), property_resolve(C, "state"). =====result @@ -2449,7 +2435,7 @@ false =====query subject_class("Todo", C), property_resolve(C, "title"). =====result -[{"C":"c"}] +[{"bindings":{"C":{"atom":"c"}}}] =====query subject_class("Todo", C), property_resolve(C, "isLiked"). =====result @@ -2457,7 +2443,7 @@ false =====query subject_class("Todo", C), property_setter(C, Property, Setter). =====result -[{"C":"c","Property":"state","Setter":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://state\", target: \"value\"}]"},{"C":"c","Property":"title","Setter":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://has_title\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"c"},"Property":"state","Setter":{"atom":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://state\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Property":"title","Setter":{"atom":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://has_title\", target: \"value\"}]"}}}] =====query subject_class("Todo", C), property_resolve_language(C, "state", Language). =====result @@ -2465,31 +2451,31 @@ false =====query subject_class("Todo", C), property_resolve_language(C, "title", Language). =====result -[{"C":"c","Language":"literal"}] +[{"bindings":{"C":{"atom":"c"},"Language":"literal"}}] =====query subject_class("Todo", C), collection(C, Collection). =====result -[{"C":"c","Collection":"comments"},{"C":"c","Collection":"entries"},{"C":"c","Collection":"messages"},{"C":"c","Collection":"likedMessages"}] +[{"bindings":{"C":{"atom":"c"},"Collection":"comments"}},{"bindings":{"C":{"atom":"c"},"Collection":"entries"}},{"bindings":{"C":{"atom":"c"},"Collection":"messages"}},{"bindings":{"C":{"atom":"c"},"Collection":"likedMessages"}}] =====query subject_class("Todo", C), collection_adder(C, Collection, Adder). =====result -[{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]","C":"c","Collection":"commentss"},{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]","C":"c","Collection":"entriess"},{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]","C":"c","Collection":"messagess"},{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]","C":"c","Collection":"likedMessagess"}] +[{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"commentss"}},{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"entriess"}},{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"messagess"}},{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"likedMessagess"}}] =====query subject_class("Todo", C), collection_remover(C, Collection, Remover). =====result -[{"C":"c","Collection":"commentss","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"},{"C":"c","Collection":"entriess","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"messagess","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"likedMessagess","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"c"},"Collection":"commentss","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"entriess","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"messagess","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"likedMessagess","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}}] =====query subject_class("Todo", C), collection_setter(C, Collection, Setter). =====result -[{"C":"c","Collection":"commentss","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"},{"C":"c","Collection":"entriess","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"messagess","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"likedMessagess","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"c"},"Collection":"commentss","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"entriess","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"messagess","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"likedMessagess","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}}] =====query subject_class("Todo", C), instance(C, "literal://string:Decorated%20class%20construction%20test"). =====result -[{"C":"c"}] +[{"bindings":{"C":{"atom":"c"}}}] =====query subject_class("Todo", C), property(C, Property). =====result -[{"C":"c","Property":"state"},{"C":"c","Property":"title"},{"C":"c","Property":"isLiked"}] +[{"bindings":{"C":{"atom":"c"},"Property":"state"}},{"bindings":{"C":{"atom":"c"},"Property":"title"}},{"bindings":{"C":{"atom":"c"},"Property":"isLiked"}}] =====query subject_class("Todo", C), property_resolve(C, "state"). =====result @@ -2497,7 +2483,7 @@ false =====query subject_class("Todo", C), property_resolve(C, "title"). =====result -[{"C":"c"}] +[{"bindings":{"C":{"atom":"c"}}}] =====query subject_class("Todo", C), property_resolve(C, "isLiked"). =====result @@ -2505,7 +2491,7 @@ false =====query subject_class("Todo", C), property_setter(C, Property, Setter). =====result -[{"C":"c","Property":"state","Setter":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://state\", target: \"value\"}]"},{"C":"c","Property":"title","Setter":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://has_title\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"c"},"Property":"state","Setter":{"atom":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://state\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Property":"title","Setter":{"atom":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://has_title\", target: \"value\"}]"}}}] =====query subject_class("Todo", C), property_resolve_language(C, "state", Language). =====result @@ -2513,35 +2499,35 @@ false =====query subject_class("Todo", C), property_resolve_language(C, "title", Language). =====result -[{"C":"c","Language":"literal"}] +[{"bindings":{"C":{"atom":"c"},"Language":"literal"}}] =====query subject_class("Todo", C), collection(C, Collection). =====result -[{"C":"c","Collection":"comments"},{"C":"c","Collection":"entries"},{"C":"c","Collection":"messages"},{"C":"c","Collection":"likedMessages"}] +[{"bindings":{"C":{"atom":"c"},"Collection":"comments"}},{"bindings":{"C":{"atom":"c"},"Collection":"entries"}},{"bindings":{"C":{"atom":"c"},"Collection":"messages"}},{"bindings":{"C":{"atom":"c"},"Collection":"likedMessages"}}] =====query subject_class("Todo", C), collection_adder(C, Collection, Adder). =====result -[{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]","C":"c","Collection":"commentss"},{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]","C":"c","Collection":"entriess"},{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]","C":"c","Collection":"messagess"},{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]","C":"c","Collection":"likedMessagess"}] +[{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"commentss"}},{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"entriess"}},{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"messagess"}},{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"likedMessagess"}}] =====query subject_class("Todo", C), collection_remover(C, Collection, Remover). =====result -[{"C":"c","Collection":"commentss","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"},{"C":"c","Collection":"entriess","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"messagess","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"likedMessagess","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"c"},"Collection":"commentss","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"entriess","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"messagess","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"likedMessagess","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}}] =====query subject_class("Todo", C), collection_setter(C, Collection, Setter). =====result -[{"C":"c","Collection":"commentss","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"},{"C":"c","Collection":"entriess","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"messagess","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"likedMessagess","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"c"},"Collection":"commentss","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"entriess","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"messagess","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"likedMessagess","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}}] =====query subject_class("Todo", C), instance(C, Instance), property_getter(C, Instance, "state", "todo://ready"). =====result -[{"C":"c","Instance":"literal://string:get%20proxy%20test"}] +[{"bindings":{"C":{"atom":"c"},"Instance":"literal://string:get%20proxy%20test"}}] =====query subject_class("Todo", C), instance(C, "literal://string:get%20proxy%20test"). =====result -[{"C":"c"}] +[{"bindings":{"C":{"atom":"c"}}}] =====query subject_class("Todo", C), property(C, Property). =====result -[{"C":"c","Property":"state"},{"C":"c","Property":"title"},{"C":"c","Property":"isLiked"}] +[{"bindings":{"C":{"atom":"c"},"Property":"state"}},{"bindings":{"C":{"atom":"c"},"Property":"title"}},{"bindings":{"C":{"atom":"c"},"Property":"isLiked"}}] =====query subject_class("Todo", C), property_resolve(C, "state"). =====result @@ -2549,7 +2535,7 @@ false =====query subject_class("Todo", C), property_resolve(C, "title"). =====result -[{"C":"c"}] +[{"bindings":{"C":{"atom":"c"}}}] =====query subject_class("Todo", C), property_resolve(C, "isLiked"). =====result @@ -2557,7 +2543,7 @@ false =====query subject_class("Todo", C), property_setter(C, Property, Setter). =====result -[{"C":"c","Property":"state","Setter":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://state\", target: \"value\"}]"},{"C":"c","Property":"title","Setter":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://has_title\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"c"},"Property":"state","Setter":{"atom":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://state\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Property":"title","Setter":{"atom":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://has_title\", target: \"value\"}]"}}}] =====query subject_class("Todo", C), property_resolve_language(C, "state", Language). =====result @@ -2565,39 +2551,39 @@ false =====query subject_class("Todo", C), property_resolve_language(C, "title", Language). =====result -[{"C":"c","Language":"literal"}] +[{"bindings":{"C":{"atom":"c"},"Language":"literal"}}] =====query subject_class("Todo", C), collection(C, Collection). =====result -[{"C":"c","Collection":"comments"},{"C":"c","Collection":"entries"},{"C":"c","Collection":"messages"},{"C":"c","Collection":"likedMessages"}] +[{"bindings":{"C":{"atom":"c"},"Collection":"comments"}},{"bindings":{"C":{"atom":"c"},"Collection":"entries"}},{"bindings":{"C":{"atom":"c"},"Collection":"messages"}},{"bindings":{"C":{"atom":"c"},"Collection":"likedMessages"}}] =====query subject_class("Todo", C), collection_adder(C, Collection, Adder). =====result -[{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]","C":"c","Collection":"commentss"},{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]","C":"c","Collection":"entriess"},{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]","C":"c","Collection":"messagess"},{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]","C":"c","Collection":"likedMessagess"}] +[{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"commentss"}},{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"entriess"}},{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"messagess"}},{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"likedMessagess"}}] =====query subject_class("Todo", C), collection_remover(C, Collection, Remover). =====result -[{"C":"c","Collection":"commentss","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"},{"C":"c","Collection":"entriess","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"messagess","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"likedMessagess","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"c"},"Collection":"commentss","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"entriess","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"messagess","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"likedMessagess","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}}] =====query subject_class("Todo", C), collection_setter(C, Collection, Setter). =====result -[{"C":"c","Collection":"commentss","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"},{"C":"c","Collection":"entriess","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"messagess","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"likedMessagess","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"c"},"Collection":"commentss","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"entriess","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"messagess","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"likedMessagess","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}}] =====query subject_class("Todo", C), property_getter(C, "literal://string:get%20proxy%20test", "state", Value). =====result -[{"C":"c","Value":"todo://ready"}] +[{"bindings":{"C":{"atom":"c"},"Value":"todo://ready"}}] =====query subject_class("Todo", C), instance(C, Instance), property_getter(C, Instance, "state", "todo://done"). =====result -[{"C":"c","Instance":"literal://string:construct%20test"}] +[{"bindings":{"C":{"atom":"c"},"Instance":"literal://string:construct%20test"}}] =====query subject_class("Todo", C), instance(C, "literal://string:construct%20test"). =====result -[{"C":"c"}] +[{"bindings":{"C":{"atom":"c"}}}] =====query subject_class("Todo", C), property(C, Property). =====result -[{"C":"c","Property":"state"},{"C":"c","Property":"title"},{"C":"c","Property":"isLiked"}] +[{"bindings":{"C":{"atom":"c"},"Property":"state"}},{"bindings":{"C":{"atom":"c"},"Property":"title"}},{"bindings":{"C":{"atom":"c"},"Property":"isLiked"}}] =====query subject_class("Todo", C), property_resolve(C, "state"). =====result @@ -2605,7 +2591,7 @@ false =====query subject_class("Todo", C), property_resolve(C, "title"). =====result -[{"C":"c"}] +[{"bindings":{"C":{"atom":"c"}}}] =====query subject_class("Todo", C), property_resolve(C, "isLiked"). =====result @@ -2613,7 +2599,7 @@ false =====query subject_class("Todo", C), property_setter(C, Property, Setter). =====result -[{"C":"c","Property":"state","Setter":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://state\", target: \"value\"}]"},{"C":"c","Property":"title","Setter":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://has_title\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"c"},"Property":"state","Setter":{"atom":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://state\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Property":"title","Setter":{"atom":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://has_title\", target: \"value\"}]"}}}] =====query subject_class("Todo", C), property_resolve_language(C, "state", Language). =====result @@ -2621,27 +2607,27 @@ false =====query subject_class("Todo", C), property_resolve_language(C, "title", Language). =====result -[{"C":"c","Language":"literal"}] +[{"bindings":{"C":{"atom":"c"},"Language":"literal"}}] =====query subject_class("Todo", C), collection(C, Collection). =====result -[{"C":"c","Collection":"comments"},{"C":"c","Collection":"entries"},{"C":"c","Collection":"messages"},{"C":"c","Collection":"likedMessages"}] +[{"bindings":{"C":{"atom":"c"},"Collection":"comments"}},{"bindings":{"C":{"atom":"c"},"Collection":"entries"}},{"bindings":{"C":{"atom":"c"},"Collection":"messages"}},{"bindings":{"C":{"atom":"c"},"Collection":"likedMessages"}}] =====query subject_class("Todo", C), collection_adder(C, Collection, Adder). =====result -[{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]","C":"c","Collection":"commentss"},{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]","C":"c","Collection":"entriess"},{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]","C":"c","Collection":"messagess"},{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]","C":"c","Collection":"likedMessagess"}] +[{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"commentss"}},{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"entriess"}},{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"messagess"}},{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"likedMessagess"}}] =====query subject_class("Todo", C), collection_remover(C, Collection, Remover). =====result -[{"C":"c","Collection":"commentss","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"},{"C":"c","Collection":"entriess","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"messagess","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"likedMessagess","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"c"},"Collection":"commentss","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"entriess","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"messagess","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"likedMessagess","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}}] =====query subject_class("Todo", C), collection_setter(C, Collection, Setter). =====result -[{"C":"c","Collection":"commentss","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"},{"C":"c","Collection":"entriess","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"messagess","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"likedMessagess","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"c"},"Collection":"commentss","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"entriess","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"messagess","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"likedMessagess","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}}] =====query subject_class("Todo", C), property_getter(C, "literal://string:construct%20test", "state", Value). =====result -[{"C":"c","Value":"todo://done"}] +[{"bindings":{"C":{"atom":"c"},"Value":"todo://done"}}] =====query subject_class("Todo", C), instance(C, Instance), triple("ad4m://self", _, Instance). =====result @@ -2649,15 +2635,15 @@ false =====query subject_class("Todo", C), instance(C, Instance). =====result -[{"C":"c","Instance":"literal://string:get%20proxy%20test"},{"C":"c","Instance":"literal://string:construct%20test"},{"C":"c","Instance":"literal://string:Decorated%20class%20construction%20test"}] +[{"bindings":{"C":{"atom":"c"},"Instance":"literal://string:get%20proxy%20test"}},{"bindings":{"C":{"atom":"c"},"Instance":"literal://string:construct%20test"}},{"bindings":{"C":{"atom":"c"},"Instance":"literal://string:Decorated%20class%20construction%20test"}}] =====query subject_class("Todo", C), instance(C, "literal://string:get%20proxy%20test"). =====result -[{"C":"c"}] +[{"bindings":{"C":{"atom":"c"}}}] =====query subject_class("Todo", C), property(C, Property). =====result -[{"C":"c","Property":"state"},{"C":"c","Property":"title"},{"C":"c","Property":"isLiked"}] +[{"bindings":{"C":{"atom":"c"},"Property":"state"}},{"bindings":{"C":{"atom":"c"},"Property":"title"}},{"bindings":{"C":{"atom":"c"},"Property":"isLiked"}}] =====query subject_class("Todo", C), property_resolve(C, "state"). =====result @@ -2665,7 +2651,7 @@ false =====query subject_class("Todo", C), property_resolve(C, "title"). =====result -[{"C":"c"}] +[{"bindings":{"C":{"atom":"c"}}}] =====query subject_class("Todo", C), property_resolve(C, "isLiked"). =====result @@ -2673,7 +2659,7 @@ false =====query subject_class("Todo", C), property_setter(C, Property, Setter). =====result -[{"C":"c","Property":"state","Setter":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://state\", target: \"value\"}]"},{"C":"c","Property":"title","Setter":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://has_title\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"c"},"Property":"state","Setter":{"atom":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://state\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Property":"title","Setter":{"atom":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://has_title\", target: \"value\"}]"}}}] =====query subject_class("Todo", C), property_resolve_language(C, "state", Language). =====result @@ -2681,31 +2667,31 @@ false =====query subject_class("Todo", C), property_resolve_language(C, "title", Language). =====result -[{"C":"c","Language":"literal"}] +[{"bindings":{"C":{"atom":"c"},"Language":"literal"}}] =====query subject_class("Todo", C), collection(C, Collection). =====result -[{"C":"c","Collection":"comments"},{"C":"c","Collection":"entries"},{"C":"c","Collection":"messages"},{"C":"c","Collection":"likedMessages"}] +[{"bindings":{"C":{"atom":"c"},"Collection":"comments"}},{"bindings":{"C":{"atom":"c"},"Collection":"entries"}},{"bindings":{"C":{"atom":"c"},"Collection":"messages"}},{"bindings":{"C":{"atom":"c"},"Collection":"likedMessages"}}] =====query subject_class("Todo", C), collection_adder(C, Collection, Adder). =====result -[{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]","C":"c","Collection":"commentss"},{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]","C":"c","Collection":"entriess"},{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]","C":"c","Collection":"messagess"},{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]","C":"c","Collection":"likedMessagess"}] +[{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"commentss"}},{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"entriess"}},{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"messagess"}},{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"likedMessagess"}}] =====query subject_class("Todo", C), collection_remover(C, Collection, Remover). =====result -[{"C":"c","Collection":"commentss","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"},{"C":"c","Collection":"entriess","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"messagess","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"likedMessagess","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"c"},"Collection":"commentss","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"entriess","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"messagess","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"likedMessagess","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}}] =====query subject_class("Todo", C), collection_setter(C, Collection, Setter). =====result -[{"C":"c","Collection":"commentss","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"},{"C":"c","Collection":"entriess","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"messagess","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"likedMessagess","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"c"},"Collection":"commentss","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"entriess","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"messagess","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"likedMessagess","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}}] =====query subject_class("Todo", C), instance(C, "literal://string:construct%20test"). =====result -[{"C":"c"}] +[{"bindings":{"C":{"atom":"c"}}}] =====query subject_class("Todo", C), property(C, Property). =====result -[{"C":"c","Property":"state"},{"C":"c","Property":"title"},{"C":"c","Property":"isLiked"}] +[{"bindings":{"C":{"atom":"c"},"Property":"state"}},{"bindings":{"C":{"atom":"c"},"Property":"title"}},{"bindings":{"C":{"atom":"c"},"Property":"isLiked"}}] =====query subject_class("Todo", C), property_resolve(C, "state"). =====result @@ -2713,7 +2699,7 @@ false =====query subject_class("Todo", C), property_resolve(C, "title"). =====result -[{"C":"c"}] +[{"bindings":{"C":{"atom":"c"}}}] =====query subject_class("Todo", C), property_resolve(C, "isLiked"). =====result @@ -2721,7 +2707,7 @@ false =====query subject_class("Todo", C), property_setter(C, Property, Setter). =====result -[{"C":"c","Property":"state","Setter":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://state\", target: \"value\"}]"},{"C":"c","Property":"title","Setter":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://has_title\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"c"},"Property":"state","Setter":{"atom":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://state\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Property":"title","Setter":{"atom":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://has_title\", target: \"value\"}]"}}}] =====query subject_class("Todo", C), property_resolve_language(C, "state", Language). =====result @@ -2729,31 +2715,31 @@ false =====query subject_class("Todo", C), property_resolve_language(C, "title", Language). =====result -[{"C":"c","Language":"literal"}] +[{"bindings":{"C":{"atom":"c"},"Language":"literal"}}] =====query subject_class("Todo", C), collection(C, Collection). =====result -[{"C":"c","Collection":"comments"},{"C":"c","Collection":"entries"},{"C":"c","Collection":"messages"},{"C":"c","Collection":"likedMessages"}] +[{"bindings":{"C":{"atom":"c"},"Collection":"comments"}},{"bindings":{"C":{"atom":"c"},"Collection":"entries"}},{"bindings":{"C":{"atom":"c"},"Collection":"messages"}},{"bindings":{"C":{"atom":"c"},"Collection":"likedMessages"}}] =====query subject_class("Todo", C), collection_adder(C, Collection, Adder). =====result -[{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]","C":"c","Collection":"commentss"},{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]","C":"c","Collection":"entriess"},{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]","C":"c","Collection":"messagess"},{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]","C":"c","Collection":"likedMessagess"}] +[{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"commentss"}},{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"entriess"}},{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"messagess"}},{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"likedMessagess"}}] =====query subject_class("Todo", C), collection_remover(C, Collection, Remover). =====result -[{"C":"c","Collection":"commentss","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"},{"C":"c","Collection":"entriess","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"messagess","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"likedMessagess","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"c"},"Collection":"commentss","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"entriess","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"messagess","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"likedMessagess","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}}] =====query subject_class("Todo", C), collection_setter(C, Collection, Setter). =====result -[{"C":"c","Collection":"commentss","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"},{"C":"c","Collection":"entriess","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"messagess","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"likedMessagess","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"c"},"Collection":"commentss","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"entriess","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"messagess","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"likedMessagess","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}}] =====query subject_class("Todo", C), instance(C, "literal://string:Decorated%20class%20construction%20test"). =====result -[{"C":"c"}] +[{"bindings":{"C":{"atom":"c"}}}] =====query subject_class("Todo", C), property(C, Property). =====result -[{"C":"c","Property":"state"},{"C":"c","Property":"title"},{"C":"c","Property":"isLiked"}] +[{"bindings":{"C":{"atom":"c"},"Property":"state"}},{"bindings":{"C":{"atom":"c"},"Property":"title"}},{"bindings":{"C":{"atom":"c"},"Property":"isLiked"}}] =====query subject_class("Todo", C), property_resolve(C, "state"). =====result @@ -2761,7 +2747,7 @@ false =====query subject_class("Todo", C), property_resolve(C, "title"). =====result -[{"C":"c"}] +[{"bindings":{"C":{"atom":"c"}}}] =====query subject_class("Todo", C), property_resolve(C, "isLiked"). =====result @@ -2769,7 +2755,7 @@ false =====query subject_class("Todo", C), property_setter(C, Property, Setter). =====result -[{"C":"c","Property":"state","Setter":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://state\", target: \"value\"}]"},{"C":"c","Property":"title","Setter":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://has_title\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"c"},"Property":"state","Setter":{"atom":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://state\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Property":"title","Setter":{"atom":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://has_title\", target: \"value\"}]"}}}] =====query subject_class("Todo", C), property_resolve_language(C, "state", Language). =====result @@ -2777,23 +2763,23 @@ false =====query subject_class("Todo", C), property_resolve_language(C, "title", Language). =====result -[{"C":"c","Language":"literal"}] +[{"bindings":{"C":{"atom":"c"},"Language":"literal"}}] =====query subject_class("Todo", C), collection(C, Collection). =====result -[{"C":"c","Collection":"comments"},{"C":"c","Collection":"entries"},{"C":"c","Collection":"messages"},{"C":"c","Collection":"likedMessages"}] +[{"bindings":{"C":{"atom":"c"},"Collection":"comments"}},{"bindings":{"C":{"atom":"c"},"Collection":"entries"}},{"bindings":{"C":{"atom":"c"},"Collection":"messages"}},{"bindings":{"C":{"atom":"c"},"Collection":"likedMessages"}}] =====query subject_class("Todo", C), collection_adder(C, Collection, Adder). =====result -[{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]","C":"c","Collection":"commentss"},{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]","C":"c","Collection":"entriess"},{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]","C":"c","Collection":"messagess"},{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]","C":"c","Collection":"likedMessagess"}] +[{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"commentss"}},{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"entriess"}},{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"messagess"}},{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"likedMessagess"}}] =====query subject_class("Todo", C), collection_remover(C, Collection, Remover). =====result -[{"C":"c","Collection":"commentss","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"},{"C":"c","Collection":"entriess","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"messagess","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"likedMessagess","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"c"},"Collection":"commentss","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"entriess","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"messagess","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"likedMessagess","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}}] =====query subject_class("Todo", C), collection_setter(C, Collection, Setter). =====result -[{"C":"c","Collection":"commentss","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"},{"C":"c","Collection":"entriess","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"messagess","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"likedMessagess","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"c"},"Collection":"commentss","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"entriess","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"messagess","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"likedMessagess","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}}] =====consult :- discontiguous(triple/3). :- discontiguous(link/5). @@ -2940,19 +2926,18 @@ collection_getter(c, Base, "likedMessages", List) :- setof(Target, (triple(Base, collection_adder(c, "likedMessagess", '[{action: "addLink", source: "this", predicate: "flux://entry_type", target: "value"}]'). collection_remover(c, "likedMessagess", '[{action: "removeLink", source: "this", predicate: "flux://entry_type", target: "value"}]'). collection_setter(c, "likedMessagess", '[{action: "collectionSetter", source: "this", predicate: "flux://entry_type", target: "value"}]'). - =====query subject_class("Todo", C), instance(C, Instance), triple("ad4m://self", _, Instance). =====result -[{"C":"c","Instance":"literal://string:get%20proxy%20test"}] +[{"bindings":{"C":{"atom":"c"},"Instance":"literal://string:get%20proxy%20test"}}] =====query subject_class("Todo", C), instance(C, "literal://string:get%20proxy%20test"). =====result -[{"C":"c"}] +[{"bindings":{"C":{"atom":"c"}}}] =====query subject_class("Todo", C), property(C, Property). =====result -[{"C":"c","Property":"state"},{"C":"c","Property":"title"},{"C":"c","Property":"isLiked"}] +[{"bindings":{"C":{"atom":"c"},"Property":"state"}},{"bindings":{"C":{"atom":"c"},"Property":"title"}},{"bindings":{"C":{"atom":"c"},"Property":"isLiked"}}] =====query subject_class("Todo", C), property_resolve(C, "state"). =====result @@ -2960,7 +2945,7 @@ false =====query subject_class("Todo", C), property_resolve(C, "title"). =====result -[{"C":"c"}] +[{"bindings":{"C":{"atom":"c"}}}] =====query subject_class("Todo", C), property_resolve(C, "isLiked"). =====result @@ -2968,7 +2953,7 @@ false =====query subject_class("Todo", C), property_setter(C, Property, Setter). =====result -[{"C":"c","Property":"state","Setter":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://state\", target: \"value\"}]"},{"C":"c","Property":"title","Setter":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://has_title\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"c"},"Property":"state","Setter":{"atom":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://state\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Property":"title","Setter":{"atom":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://has_title\", target: \"value\"}]"}}}] =====query subject_class("Todo", C), property_resolve_language(C, "state", Language). =====result @@ -2976,35 +2961,35 @@ false =====query subject_class("Todo", C), property_resolve_language(C, "title", Language). =====result -[{"C":"c","Language":"literal"}] +[{"bindings":{"C":{"atom":"c"},"Language":"literal"}}] =====query subject_class("Todo", C), collection(C, Collection). =====result -[{"C":"c","Collection":"comments"},{"C":"c","Collection":"entries"},{"C":"c","Collection":"messages"},{"C":"c","Collection":"likedMessages"}] +[{"bindings":{"C":{"atom":"c"},"Collection":"comments"}},{"bindings":{"C":{"atom":"c"},"Collection":"entries"}},{"bindings":{"C":{"atom":"c"},"Collection":"messages"}},{"bindings":{"C":{"atom":"c"},"Collection":"likedMessages"}}] =====query subject_class("Todo", C), collection_adder(C, Collection, Adder). =====result -[{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]","C":"c","Collection":"commentss"},{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]","C":"c","Collection":"entriess"},{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]","C":"c","Collection":"messagess"},{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]","C":"c","Collection":"likedMessagess"}] +[{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"commentss"}},{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"entriess"}},{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"messagess"}},{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"likedMessagess"}}] =====query subject_class("Todo", C), collection_remover(C, Collection, Remover). =====result -[{"C":"c","Collection":"commentss","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"},{"C":"c","Collection":"entriess","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"messagess","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"likedMessagess","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"c"},"Collection":"commentss","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"entriess","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"messagess","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"likedMessagess","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}}] =====query subject_class("Todo", C), collection_setter(C, Collection, Setter). =====result -[{"C":"c","Collection":"commentss","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"},{"C":"c","Collection":"entriess","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"messagess","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"likedMessagess","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"c"},"Collection":"commentss","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"entriess","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"messagess","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"likedMessagess","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}}] =====query subject_class("Todo", C), instance(C, Instance). =====result -[{"C":"c","Instance":"literal://string:get%20proxy%20test"},{"C":"c","Instance":"literal://string:construct%20test"},{"C":"c","Instance":"literal://string:Decorated%20class%20construction%20test"}] +[{"bindings":{"C":{"atom":"c"},"Instance":"literal://string:get%20proxy%20test"}},{"bindings":{"C":{"atom":"c"},"Instance":"literal://string:construct%20test"}},{"bindings":{"C":{"atom":"c"},"Instance":"literal://string:Decorated%20class%20construction%20test"}}] =====query subject_class("Todo", C), instance(C, "literal://string:get%20proxy%20test"). =====result -[{"C":"c"}] +[{"bindings":{"C":{"atom":"c"}}}] =====query subject_class("Todo", C), property(C, Property). =====result -[{"C":"c","Property":"state"},{"C":"c","Property":"title"},{"C":"c","Property":"isLiked"}] +[{"bindings":{"C":{"atom":"c"},"Property":"state"}},{"bindings":{"C":{"atom":"c"},"Property":"title"}},{"bindings":{"C":{"atom":"c"},"Property":"isLiked"}}] =====query subject_class("Todo", C), property_resolve(C, "state"). =====result @@ -3012,7 +2997,7 @@ false =====query subject_class("Todo", C), property_resolve(C, "title"). =====result -[{"C":"c"}] +[{"bindings":{"C":{"atom":"c"}}}] =====query subject_class("Todo", C), property_resolve(C, "isLiked"). =====result @@ -3020,7 +3005,7 @@ false =====query subject_class("Todo", C), property_setter(C, Property, Setter). =====result -[{"C":"c","Property":"state","Setter":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://state\", target: \"value\"}]"},{"C":"c","Property":"title","Setter":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://has_title\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"c"},"Property":"state","Setter":{"atom":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://state\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Property":"title","Setter":{"atom":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://has_title\", target: \"value\"}]"}}}] =====query subject_class("Todo", C), property_resolve_language(C, "state", Language). =====result @@ -3028,31 +3013,31 @@ false =====query subject_class("Todo", C), property_resolve_language(C, "title", Language). =====result -[{"C":"c","Language":"literal"}] +[{"bindings":{"C":{"atom":"c"},"Language":"literal"}}] =====query subject_class("Todo", C), collection(C, Collection). =====result -[{"C":"c","Collection":"comments"},{"C":"c","Collection":"entries"},{"C":"c","Collection":"messages"},{"C":"c","Collection":"likedMessages"}] +[{"bindings":{"C":{"atom":"c"},"Collection":"comments"}},{"bindings":{"C":{"atom":"c"},"Collection":"entries"}},{"bindings":{"C":{"atom":"c"},"Collection":"messages"}},{"bindings":{"C":{"atom":"c"},"Collection":"likedMessages"}}] =====query subject_class("Todo", C), collection_adder(C, Collection, Adder). =====result -[{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]","C":"c","Collection":"commentss"},{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]","C":"c","Collection":"entriess"},{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]","C":"c","Collection":"messagess"},{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]","C":"c","Collection":"likedMessagess"}] +[{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"commentss"}},{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"entriess"}},{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"messagess"}},{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"likedMessagess"}}] =====query subject_class("Todo", C), collection_remover(C, Collection, Remover). =====result -[{"C":"c","Collection":"commentss","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"},{"C":"c","Collection":"entriess","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"messagess","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"likedMessagess","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"c"},"Collection":"commentss","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"entriess","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"messagess","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"likedMessagess","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}}] =====query subject_class("Todo", C), collection_setter(C, Collection, Setter). =====result -[{"C":"c","Collection":"commentss","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"},{"C":"c","Collection":"entriess","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"messagess","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"likedMessagess","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"c"},"Collection":"commentss","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"entriess","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"messagess","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"likedMessagess","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}}] =====query subject_class("Todo", C), instance(C, "literal://string:construct%20test"). =====result -[{"C":"c"}] +[{"bindings":{"C":{"atom":"c"}}}] =====query subject_class("Todo", C), property(C, Property). =====result -[{"C":"c","Property":"state"},{"C":"c","Property":"title"},{"C":"c","Property":"isLiked"}] +[{"bindings":{"C":{"atom":"c"},"Property":"state"}},{"bindings":{"C":{"atom":"c"},"Property":"title"}},{"bindings":{"C":{"atom":"c"},"Property":"isLiked"}}] =====query subject_class("Todo", C), property_resolve(C, "state"). =====result @@ -3060,7 +3045,7 @@ false =====query subject_class("Todo", C), property_resolve(C, "title"). =====result -[{"C":"c"}] +[{"bindings":{"C":{"atom":"c"}}}] =====query subject_class("Todo", C), property_resolve(C, "isLiked"). =====result @@ -3068,7 +3053,7 @@ false =====query subject_class("Todo", C), property_setter(C, Property, Setter). =====result -[{"C":"c","Property":"state","Setter":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://state\", target: \"value\"}]"},{"C":"c","Property":"title","Setter":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://has_title\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"c"},"Property":"state","Setter":{"atom":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://state\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Property":"title","Setter":{"atom":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://has_title\", target: \"value\"}]"}}}] =====query subject_class("Todo", C), property_resolve_language(C, "state", Language). =====result @@ -3076,31 +3061,31 @@ false =====query subject_class("Todo", C), property_resolve_language(C, "title", Language). =====result -[{"C":"c","Language":"literal"}] +[{"bindings":{"C":{"atom":"c"},"Language":"literal"}}] =====query subject_class("Todo", C), collection(C, Collection). =====result -[{"C":"c","Collection":"comments"},{"C":"c","Collection":"entries"},{"C":"c","Collection":"messages"},{"C":"c","Collection":"likedMessages"}] +[{"bindings":{"C":{"atom":"c"},"Collection":"comments"}},{"bindings":{"C":{"atom":"c"},"Collection":"entries"}},{"bindings":{"C":{"atom":"c"},"Collection":"messages"}},{"bindings":{"C":{"atom":"c"},"Collection":"likedMessages"}}] =====query subject_class("Todo", C), collection_adder(C, Collection, Adder). =====result -[{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]","C":"c","Collection":"commentss"},{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]","C":"c","Collection":"entriess"},{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]","C":"c","Collection":"messagess"},{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]","C":"c","Collection":"likedMessagess"}] +[{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"commentss"}},{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"entriess"}},{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"messagess"}},{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"likedMessagess"}}] =====query subject_class("Todo", C), collection_remover(C, Collection, Remover). =====result -[{"C":"c","Collection":"commentss","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"},{"C":"c","Collection":"entriess","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"messagess","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"likedMessagess","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"c"},"Collection":"commentss","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"entriess","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"messagess","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"likedMessagess","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}}] =====query subject_class("Todo", C), collection_setter(C, Collection, Setter). =====result -[{"C":"c","Collection":"commentss","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"},{"C":"c","Collection":"entriess","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"messagess","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"likedMessagess","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"c"},"Collection":"commentss","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"entriess","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"messagess","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"likedMessagess","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}}] =====query subject_class("Todo", C), instance(C, "literal://string:Decorated%20class%20construction%20test"). =====result -[{"C":"c"}] +[{"bindings":{"C":{"atom":"c"}}}] =====query subject_class("Todo", C), property(C, Property). =====result -[{"C":"c","Property":"state"},{"C":"c","Property":"title"},{"C":"c","Property":"isLiked"}] +[{"bindings":{"C":{"atom":"c"},"Property":"state"}},{"bindings":{"C":{"atom":"c"},"Property":"title"}},{"bindings":{"C":{"atom":"c"},"Property":"isLiked"}}] =====query subject_class("Todo", C), property_resolve(C, "state"). =====result @@ -3108,7 +3093,7 @@ false =====query subject_class("Todo", C), property_resolve(C, "title"). =====result -[{"C":"c"}] +[{"bindings":{"C":{"atom":"c"}}}] =====query subject_class("Todo", C), property_resolve(C, "isLiked"). =====result @@ -3116,7 +3101,7 @@ false =====query subject_class("Todo", C), property_setter(C, Property, Setter). =====result -[{"C":"c","Property":"state","Setter":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://state\", target: \"value\"}]"},{"C":"c","Property":"title","Setter":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://has_title\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"c"},"Property":"state","Setter":{"atom":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://state\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Property":"title","Setter":{"atom":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://has_title\", target: \"value\"}]"}}}] =====query subject_class("Todo", C), property_resolve_language(C, "state", Language). =====result @@ -3124,23 +3109,23 @@ false =====query subject_class("Todo", C), property_resolve_language(C, "title", Language). =====result -[{"C":"c","Language":"literal"}] +[{"bindings":{"C":{"atom":"c"},"Language":"literal"}}] =====query subject_class("Todo", C), collection(C, Collection). =====result -[{"C":"c","Collection":"comments"},{"C":"c","Collection":"entries"},{"C":"c","Collection":"messages"},{"C":"c","Collection":"likedMessages"}] +[{"bindings":{"C":{"atom":"c"},"Collection":"comments"}},{"bindings":{"C":{"atom":"c"},"Collection":"entries"}},{"bindings":{"C":{"atom":"c"},"Collection":"messages"}},{"bindings":{"C":{"atom":"c"},"Collection":"likedMessages"}}] =====query subject_class("Todo", C), collection_adder(C, Collection, Adder). =====result -[{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]","C":"c","Collection":"commentss"},{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]","C":"c","Collection":"entriess"},{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]","C":"c","Collection":"messagess"},{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]","C":"c","Collection":"likedMessagess"}] +[{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"commentss"}},{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"entriess"}},{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"messagess"}},{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"likedMessagess"}}] =====query subject_class("Todo", C), collection_remover(C, Collection, Remover). =====result -[{"C":"c","Collection":"commentss","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"},{"C":"c","Collection":"entriess","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"messagess","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"likedMessagess","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"c"},"Collection":"commentss","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"entriess","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"messagess","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"likedMessagess","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}}] =====query subject_class("Todo", C), collection_setter(C, Collection, Setter). =====result -[{"C":"c","Collection":"commentss","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"},{"C":"c","Collection":"entriess","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"messagess","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"likedMessagess","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"c"},"Collection":"commentss","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"entriess","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"messagess","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"likedMessagess","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}}] =====query subject_class("Todo", C), property_getter(C, "literal://string:get%20proxy%20test", "title", Value). =====result @@ -3296,11 +3281,10 @@ collection_getter(c, Base, "likedMessages", List) :- setof(Target, (triple(Base, collection_adder(c, "likedMessagess", '[{action: "addLink", source: "this", predicate: "flux://entry_type", target: "value"}]'). collection_remover(c, "likedMessagess", '[{action: "removeLink", source: "this", predicate: "flux://entry_type", target: "value"}]'). collection_setter(c, "likedMessagess", '[{action: "collectionSetter", source: "this", predicate: "flux://entry_type", target: "value"}]'). - =====query subject_class("Todo", C), property_getter(C, "literal://string:get%20proxy%20test", "title", Value). =====result -[{"C":"c","Value":"literal://json:%7B%22author%22%3A%22did%3Akey%3Az6MkfCr9Wg3J5EdakDEJQM3VdSRn6nDTSwtEd1AC8V7E4Qpp%22%2C%22timestamp%22%3A%222024-02-01T12%3A28%3A50.709Z%22%2C%22data%22%3A%22new%20title%22%2C%22proof%22%3A%7B%22key%22%3A%22did%3Akey%3Az6MkfCr9Wg3J5EdakDEJQM3VdSRn6nDTSwtEd1AC8V7E4Qpp%23z6MkfCr9Wg3J5EdakDEJQM3VdSRn6nDTSwtEd1AC8V7E4Qpp%22%2C%22signature%22%3A%228b38bc97dfc170aba49f2b5c085051194887b1f2b12a9636f2c7442c61c1509006deeed9017701d5e3705b353e5dc5ef318497c16f2018bc3aa7e0882acff502%22%2C%22valid%22%3Atrue%2C%22invalid%22%3Afalse%7D%7D"}] +[{"bindings":{"C":{"atom":"c"},"Value":"literal://json:%7B%22author%22%3A%22did%3Akey%3Az6MkfCr9Wg3J5EdakDEJQM3VdSRn6nDTSwtEd1AC8V7E4Qpp%22%2C%22timestamp%22%3A%222024-02-01T12%3A28%3A50.709Z%22%2C%22data%22%3A%22new%20title%22%2C%22proof%22%3A%7B%22key%22%3A%22did%3Akey%3Az6MkfCr9Wg3J5EdakDEJQM3VdSRn6nDTSwtEd1AC8V7E4Qpp%23z6MkfCr9Wg3J5EdakDEJQM3VdSRn6nDTSwtEd1AC8V7E4Qpp%22%2C%22signature%22%3A%228b38bc97dfc170aba49f2b5c085051194887b1f2b12a9636f2c7442c61c1509006deeed9017701d5e3705b353e5dc5ef318497c16f2018bc3aa7e0882acff502%22%2C%22valid%22%3Atrue%2C%22invalid%22%3Afalse%7D%7D"}}] =====query subject_class(Class, C), property(C, "number"). =====result @@ -3471,16 +3455,14 @@ destructor(srksdbln, '[]'). property(srksdbln, "number"). property_getter(srksdbln, Base, "number", Value) :- triple(Base, "test://test_numer", Value). - - =====query subject_class(Class, C), property(C, "state"), property(C, "title"), property(C, "isLiked"), property_setter(C, "state", _), property_setter(C, "title", _), collection_adder(C, "commentss", _), collection_adder(C, "entriess", _), collection_adder(C, "messagess", _), collection_adder(C, "likedMessagess", _), collection_remover(C, "commentss", _), collection_remover(C, "entriess", _), collection_remover(C, "messagess", _), collection_remover(C, "likedMessagess", _), collection_setter(C, "commentss", _), collection_setter(C, "entriess", _), collection_setter(C, "messagess", _), collection_setter(C, "likedMessagess", _). =====result -[{"C":"c","Class":"Todo"}] +[{"bindings":{"C":{"atom":"c"},"Class":"Todo"}}] =====query subject_class("Todo", C), constructor(C, Actions). =====result -[{"Actions":"[{action: \"addLink\", source: \"this\", predicate: \"todo://state\", target: \"todo://ready\"}]","C":"c"}] +[{"bindings":{"Actions":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"todo://state\", target: \"todo://ready\"}]"},"C":{"atom":"c"}}}] =====consult :- discontiguous(triple/3). :- discontiguous(link/5). @@ -3652,28 +3634,26 @@ destructor(srksdbln, '[]'). property(srksdbln, "number"). property_getter(srksdbln, Base, "number", Value) :- triple(Base, "test://test_numer", Value). - - =====query subject_class(Class, C), property(C, "state"), property(C, "title"), property(C, "isLiked"), property_setter(C, "state", _), property_setter(C, "title", _), collection_adder(C, "commentss", _), collection_adder(C, "entriess", _), collection_adder(C, "messagess", _), collection_adder(C, "likedMessagess", _), collection_remover(C, "commentss", _), collection_remover(C, "entriess", _), collection_remover(C, "messagess", _), collection_remover(C, "likedMessagess", _), collection_setter(C, "commentss", _), collection_setter(C, "entriess", _), collection_setter(C, "messagess", _), collection_setter(C, "likedMessagess", _). =====result -[{"C":"c","Class":"Todo"}] +[{"bindings":{"C":{"atom":"c"},"Class":"Todo"}}] =====query subject_class("Todo", C), instance(C, "literal://string:Collection%20where%20test%20with%20prolog%20condition"). =====result -[{"C":"c"}] +[{"bindings":{"C":{"atom":"c"}}}] =====query subject_class(Class, C), property(C, "state"), property(C, "title"), property(C, "isLiked"), property_setter(C, "state", _), property_setter(C, "title", _), collection_adder(C, "commentss", _), collection_adder(C, "entriess", _), collection_adder(C, "messagess", _), collection_adder(C, "likedMessagess", _), collection_remover(C, "commentss", _), collection_remover(C, "entriess", _), collection_remover(C, "messagess", _), collection_remover(C, "likedMessagess", _), collection_setter(C, "commentss", _), collection_setter(C, "entriess", _), collection_setter(C, "messagess", _), collection_setter(C, "likedMessagess", _). =====result -[{"C":"c","Class":"Todo"}] +[{"bindings":{"C":{"atom":"c"},"Class":"Todo"}}] =====query subject_class("Todo", C), instance(C, "literal://string:Collection%20where%20test%20with%20prolog%20condition"). =====result -[{"C":"c"}] +[{"bindings":{"C":{"atom":"c"}}}] =====query subject_class("Todo", C), property(C, Property). =====result -[{"C":"c","Property":"state"},{"C":"c","Property":"title"},{"C":"c","Property":"isLiked"}] +[{"bindings":{"C":{"atom":"c"},"Property":"state"}},{"bindings":{"C":{"atom":"c"},"Property":"title"}},{"bindings":{"C":{"atom":"c"},"Property":"isLiked"}}] =====query subject_class("Todo", C), property_resolve(C, "state"). =====result @@ -3681,7 +3661,7 @@ false =====query subject_class("Todo", C), property_resolve(C, "title"). =====result -[{"C":"c"}] +[{"bindings":{"C":{"atom":"c"}}}] =====query subject_class("Todo", C), property_resolve(C, "isLiked"). =====result @@ -3689,7 +3669,7 @@ false =====query subject_class("Todo", C), property_setter(C, Property, Setter). =====result -[{"C":"c","Property":"state","Setter":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://state\", target: \"value\"}]"},{"C":"c","Property":"title","Setter":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://has_title\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"c"},"Property":"state","Setter":{"atom":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://state\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Property":"title","Setter":{"atom":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://has_title\", target: \"value\"}]"}}}] =====query subject_class("Todo", C), property_resolve_language(C, "state", Language). =====result @@ -3697,23 +3677,23 @@ false =====query subject_class("Todo", C), property_resolve_language(C, "title", Language). =====result -[{"C":"c","Language":"literal"}] +[{"bindings":{"C":{"atom":"c"},"Language":"literal"}}] =====query subject_class("Todo", C), collection(C, Collection). =====result -[{"C":"c","Collection":"comments"},{"C":"c","Collection":"entries"},{"C":"c","Collection":"messages"},{"C":"c","Collection":"likedMessages"}] +[{"bindings":{"C":{"atom":"c"},"Collection":"comments"}},{"bindings":{"C":{"atom":"c"},"Collection":"entries"}},{"bindings":{"C":{"atom":"c"},"Collection":"messages"}},{"bindings":{"C":{"atom":"c"},"Collection":"likedMessages"}}] =====query subject_class("Todo", C), collection_adder(C, Collection, Adder). =====result -[{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]","C":"c","Collection":"commentss"},{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]","C":"c","Collection":"entriess"},{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]","C":"c","Collection":"messagess"},{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]","C":"c","Collection":"likedMessagess"}] +[{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"commentss"}},{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"entriess"}},{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"messagess"}},{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"likedMessagess"}}] =====query subject_class("Todo", C), collection_remover(C, Collection, Remover). =====result -[{"C":"c","Collection":"commentss","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"},{"C":"c","Collection":"entriess","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"messagess","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"likedMessagess","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"c"},"Collection":"commentss","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"entriess","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"messagess","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"likedMessagess","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}}] =====query subject_class("Todo", C), collection_setter(C, Collection, Setter). =====result -[{"C":"c","Collection":"commentss","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"},{"C":"c","Collection":"entriess","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"messagess","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"likedMessagess","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"c"},"Collection":"commentss","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"entriess","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"messagess","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"likedMessagess","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}}] =====consult :- discontiguous(triple/3). :- discontiguous(link/5). @@ -3890,12 +3870,10 @@ destructor(srksdbln, '[]'). property(srksdbln, "number"). property_getter(srksdbln, Base, "number", Value) :- triple(Base, "test://test_numer", Value). - - =====query subject_class("Todo", C), collection_getter(C, "literal://string:Collection%20where%20test%20with%20prolog%20condition", "entries", Value). =====result -[{"C":"c","Value":["literal://string:test%20message"]}] +[{"bindings":{"C":{"atom":"c"},"Value":["literal://string:test%20message"]}}] =====query subject_class("Todo", C), collection_getter(C, "literal://string:Collection%20where%20test%20with%20prolog%20condition", "likedMessages", Value). =====result @@ -4078,20 +4056,18 @@ destructor(srksdbln, '[]'). property(srksdbln, "number"). property_getter(srksdbln, Base, "number", Value) :- triple(Base, "test://test_numer", Value). - - =====query subject_class("Todo", C), collection_getter(C, "literal://string:Collection%20where%20test%20with%20prolog%20condition", "likedMessages", Value). =====result -[{"C":"c","Value":["literal://string:test%20message"]}] +[{"bindings":{"C":{"atom":"c"},"Value":["literal://string:test%20message"]}}] =====query subject_class(Class, C), property(C, "state"), property(C, "title"), property(C, "isLiked"), property_setter(C, "state", _), property_setter(C, "title", _), collection_adder(C, "commentss", _), collection_adder(C, "entriess", _), collection_adder(C, "messagess", _), collection_adder(C, "likedMessagess", _), collection_remover(C, "commentss", _), collection_remover(C, "entriess", _), collection_remover(C, "messagess", _), collection_remover(C, "likedMessagess", _), collection_setter(C, "commentss", _), collection_setter(C, "entriess", _), collection_setter(C, "messagess", _), collection_setter(C, "likedMessagess", _). =====result -[{"C":"c","Class":"Todo"}] +[{"bindings":{"C":{"atom":"c"},"Class":"Todo"}}] =====query subject_class("Todo", C), constructor(C, Actions). =====result -[{"Actions":"[{action: \"addLink\", source: \"this\", predicate: \"todo://state\", target: \"todo://ready\"}]","C":"c"}] +[{"bindings":{"Actions":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"todo://state\", target: \"todo://ready\"}]"},"C":{"atom":"c"}}}] =====consult :- discontiguous(triple/3). :- discontiguous(link/5). @@ -4275,28 +4251,26 @@ destructor(srksdbln, '[]'). property(srksdbln, "number"). property_getter(srksdbln, Base, "number", Value) :- triple(Base, "test://test_numer", Value). - - =====query subject_class(Class, C), property(C, "state"), property(C, "title"), property(C, "isLiked"), property_setter(C, "state", _), property_setter(C, "title", _), collection_adder(C, "commentss", _), collection_adder(C, "entriess", _), collection_adder(C, "messagess", _), collection_adder(C, "likedMessagess", _), collection_remover(C, "commentss", _), collection_remover(C, "entriess", _), collection_remover(C, "messagess", _), collection_remover(C, "likedMessagess", _), collection_setter(C, "commentss", _), collection_setter(C, "entriess", _), collection_setter(C, "messagess", _), collection_setter(C, "likedMessagess", _). =====result -[{"C":"c","Class":"Todo"}] +[{"bindings":{"C":{"atom":"c"},"Class":"Todo"}}] =====query subject_class("Todo", C), instance(C, "literal://string:Custom%20getter%20test"). =====result -[{"C":"c"}] +[{"bindings":{"C":{"atom":"c"}}}] =====query subject_class(Class, C), property(C, "state"), property(C, "title"), property(C, "isLiked"), property_setter(C, "state", _), property_setter(C, "title", _), collection_adder(C, "commentss", _), collection_adder(C, "entriess", _), collection_adder(C, "messagess", _), collection_adder(C, "likedMessagess", _), collection_remover(C, "commentss", _), collection_remover(C, "entriess", _), collection_remover(C, "messagess", _), collection_remover(C, "likedMessagess", _), collection_setter(C, "commentss", _), collection_setter(C, "entriess", _), collection_setter(C, "messagess", _), collection_setter(C, "likedMessagess", _). =====result -[{"C":"c","Class":"Todo"}] +[{"bindings":{"C":{"atom":"c"},"Class":"Todo"}}] =====query subject_class("Todo", C), instance(C, "literal://string:Custom%20getter%20test"). =====result -[{"C":"c"}] +[{"bindings":{"C":{"atom":"c"}}}] =====query subject_class("Todo", C), property(C, Property). =====result -[{"C":"c","Property":"state"},{"C":"c","Property":"title"},{"C":"c","Property":"isLiked"}] +[{"bindings":{"C":{"atom":"c"},"Property":"state"}},{"bindings":{"C":{"atom":"c"},"Property":"title"}},{"bindings":{"C":{"atom":"c"},"Property":"isLiked"}}] =====query subject_class("Todo", C), property_resolve(C, "state"). =====result @@ -4304,7 +4278,7 @@ false =====query subject_class("Todo", C), property_resolve(C, "title"). =====result -[{"C":"c"}] +[{"bindings":{"C":{"atom":"c"}}}] =====query subject_class("Todo", C), property_resolve(C, "isLiked"). =====result @@ -4312,7 +4286,7 @@ false =====query subject_class("Todo", C), property_setter(C, Property, Setter). =====result -[{"C":"c","Property":"state","Setter":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://state\", target: \"value\"}]"},{"C":"c","Property":"title","Setter":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://has_title\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"c"},"Property":"state","Setter":{"atom":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://state\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Property":"title","Setter":{"atom":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://has_title\", target: \"value\"}]"}}}] =====query subject_class("Todo", C), property_resolve_language(C, "state", Language). =====result @@ -4320,23 +4294,23 @@ false =====query subject_class("Todo", C), property_resolve_language(C, "title", Language). =====result -[{"C":"c","Language":"literal"}] +[{"bindings":{"C":{"atom":"c"},"Language":"literal"}}] =====query subject_class("Todo", C), collection(C, Collection). =====result -[{"C":"c","Collection":"comments"},{"C":"c","Collection":"entries"},{"C":"c","Collection":"messages"},{"C":"c","Collection":"likedMessages"}] +[{"bindings":{"C":{"atom":"c"},"Collection":"comments"}},{"bindings":{"C":{"atom":"c"},"Collection":"entries"}},{"bindings":{"C":{"atom":"c"},"Collection":"messages"}},{"bindings":{"C":{"atom":"c"},"Collection":"likedMessages"}}] =====query subject_class("Todo", C), collection_adder(C, Collection, Adder). =====result -[{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]","C":"c","Collection":"commentss"},{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]","C":"c","Collection":"entriess"},{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]","C":"c","Collection":"messagess"},{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]","C":"c","Collection":"likedMessagess"}] +[{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"commentss"}},{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"entriess"}},{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"messagess"}},{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"likedMessagess"}}] =====query subject_class("Todo", C), collection_remover(C, Collection, Remover). =====result -[{"C":"c","Collection":"commentss","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"},{"C":"c","Collection":"entriess","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"messagess","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"likedMessagess","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"c"},"Collection":"commentss","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"entriess","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"messagess","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"likedMessagess","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}}] =====query subject_class("Todo", C), collection_setter(C, Collection, Setter). =====result -[{"C":"c","Collection":"commentss","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"},{"C":"c","Collection":"entriess","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"messagess","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"likedMessagess","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"c"},"Collection":"commentss","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"entriess","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"messagess","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"likedMessagess","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}}] =====query subject_class("Todo", C), property_getter(C, "literal://string:Custom%20getter%20test", "isLiked", Value). =====result @@ -4526,12 +4500,10 @@ destructor(srksdbln, '[]'). property(srksdbln, "number"). property_getter(srksdbln, Base, "number", Value) :- triple(Base, "test://test_numer", Value). - - =====query subject_class("Todo", C), property_getter(C, "literal://string:Custom%20getter%20test", "isLiked", Value). =====result -[{"C":"c","Value":true}] +[{"bindings":{"C":{"atom":"c"},"Value":true}}] =====consult :- discontiguous(triple/3). :- discontiguous(link/5). @@ -4741,8 +4713,6 @@ property_getter(mqvvfluy, Base, "type", Value) :- triple(Base, "ad4m://type", Va property(mqvvfluy, "body"). property_getter(mqvvfluy, Base, "body", Value) :- triple(Base, "todo://state", Value). property_setter(mqvvfluy, "body", '[{action: "setSingleTarget", source: "this", predicate: "todo://state", target: "value"}]'). - - =====query subject_class("Message", C), instance(C, Instance). =====result @@ -4958,20 +4928,18 @@ property_getter(mqvvfluy, Base, "type", Value) :- triple(Base, "ad4m://type", Va property(mqvvfluy, "body"). property_getter(mqvvfluy, Base, "body", Value) :- triple(Base, "todo://state", Value). property_setter(mqvvfluy, "body", '[{action: "setSingleTarget", source: "this", predicate: "todo://state", target: "value"}]'). - - =====query subject_class("Message", C), instance(C, Instance). =====result -[{"C":"mqvvfluy","Instance":"test://message"}] +[{"bindings":{"C":{"atom":"mqvvfluy"},"Instance":"test://message"}}] =====query subject_class("Message", C), instance(C, "test://message"). =====result -[{"C":"mqvvfluy"}] +[{"bindings":{"C":{"atom":"mqvvfluy"}}}] =====query subject_class("Message", C), property(C, Property). =====result -[{"C":"mqvvfluy","Property":"type"},{"C":"mqvvfluy","Property":"body"}] +[{"bindings":{"C":{"atom":"mqvvfluy"},"Property":"type"}},{"bindings":{"C":{"atom":"mqvvfluy"},"Property":"body"}}] =====query subject_class("Message", C), property_resolve(C, "type"). =====result @@ -4983,7 +4951,7 @@ false =====query subject_class("Message", C), property_setter(C, Property, Setter). =====result -[{"C":"mqvvfluy","Property":"body","Setter":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://state\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"mqvvfluy"},"Property":"body","Setter":{"atom":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://state\", target: \"value\"}]"}}}] =====query subject_class("Message", C), property_resolve_language(C, "body", Language). =====result @@ -5007,11 +4975,11 @@ false =====query subject_class(Class, C), property(C, "state"), property(C, "title"), property(C, "isLiked"), property_setter(C, "state", _), property_setter(C, "title", _), collection_adder(C, "commentss", _), collection_adder(C, "entriess", _), collection_adder(C, "messagess", _), collection_adder(C, "likedMessagess", _), collection_remover(C, "commentss", _), collection_remover(C, "entriess", _), collection_remover(C, "messagess", _), collection_remover(C, "likedMessagess", _), collection_setter(C, "commentss", _), collection_setter(C, "entriess", _), collection_setter(C, "messagess", _), collection_setter(C, "likedMessagess", _). =====result -[{"C":"c","Class":"Todo"}] +[{"bindings":{"C":{"atom":"c"},"Class":"Todo"}}] =====query subject_class("Todo", C), constructor(C, Actions). =====result -[{"Actions":"[{action: \"addLink\", source: \"this\", predicate: \"todo://state\", target: \"todo://ready\"}]","C":"c"}] +[{"bindings":{"Actions":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"todo://state\", target: \"todo://ready\"}]"},"C":{"atom":"c"}}}] =====consult :- discontiguous(triple/3). :- discontiguous(link/5). @@ -5228,28 +5196,26 @@ property_getter(mqvvfluy, Base, "type", Value) :- triple(Base, "ad4m://type", Va property(mqvvfluy, "body"). property_getter(mqvvfluy, Base, "body", Value) :- triple(Base, "todo://state", Value). property_setter(mqvvfluy, "body", '[{action: "setSingleTarget", source: "this", predicate: "todo://state", target: "value"}]'). - - =====query subject_class(Class, C), property(C, "state"), property(C, "title"), property(C, "isLiked"), property_setter(C, "state", _), property_setter(C, "title", _), collection_adder(C, "commentss", _), collection_adder(C, "entriess", _), collection_adder(C, "messagess", _), collection_adder(C, "likedMessagess", _), collection_remover(C, "commentss", _), collection_remover(C, "entriess", _), collection_remover(C, "messagess", _), collection_remover(C, "likedMessagess", _), collection_setter(C, "commentss", _), collection_setter(C, "entriess", _), collection_setter(C, "messagess", _), collection_setter(C, "likedMessagess", _). =====result -[{"C":"c","Class":"Todo"}] +[{"bindings":{"C":{"atom":"c"},"Class":"Todo"}}] =====query subject_class("Todo", C), instance(C, "literal://string:Collection%20where%20test"). =====result -[{"C":"c"}] +[{"bindings":{"C":{"atom":"c"}}}] =====query subject_class(Class, C), property(C, "state"), property(C, "title"), property(C, "isLiked"), property_setter(C, "state", _), property_setter(C, "title", _), collection_adder(C, "commentss", _), collection_adder(C, "entriess", _), collection_adder(C, "messagess", _), collection_adder(C, "likedMessagess", _), collection_remover(C, "commentss", _), collection_remover(C, "entriess", _), collection_remover(C, "messagess", _), collection_remover(C, "likedMessagess", _), collection_setter(C, "commentss", _), collection_setter(C, "entriess", _), collection_setter(C, "messagess", _), collection_setter(C, "likedMessagess", _). =====result -[{"C":"c","Class":"Todo"}] +[{"bindings":{"C":{"atom":"c"},"Class":"Todo"}}] =====query subject_class("Todo", C), instance(C, "literal://string:Collection%20where%20test"). =====result -[{"C":"c"}] +[{"bindings":{"C":{"atom":"c"}}}] =====query subject_class("Todo", C), property(C, Property). =====result -[{"C":"c","Property":"state"},{"C":"c","Property":"title"},{"C":"c","Property":"isLiked"}] +[{"bindings":{"C":{"atom":"c"},"Property":"state"}},{"bindings":{"C":{"atom":"c"},"Property":"title"}},{"bindings":{"C":{"atom":"c"},"Property":"isLiked"}}] =====query subject_class("Todo", C), property_resolve(C, "state"). =====result @@ -5257,7 +5223,7 @@ false =====query subject_class("Todo", C), property_resolve(C, "title"). =====result -[{"C":"c"}] +[{"bindings":{"C":{"atom":"c"}}}] =====query subject_class("Todo", C), property_resolve(C, "isLiked"). =====result @@ -5265,7 +5231,7 @@ false =====query subject_class("Todo", C), property_setter(C, Property, Setter). =====result -[{"C":"c","Property":"state","Setter":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://state\", target: \"value\"}]"},{"C":"c","Property":"title","Setter":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://has_title\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"c"},"Property":"state","Setter":{"atom":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://state\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Property":"title","Setter":{"atom":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://has_title\", target: \"value\"}]"}}}] =====query subject_class("Todo", C), property_resolve_language(C, "state", Language). =====result @@ -5273,23 +5239,23 @@ false =====query subject_class("Todo", C), property_resolve_language(C, "title", Language). =====result -[{"C":"c","Language":"literal"}] +[{"bindings":{"C":{"atom":"c"},"Language":"literal"}}] =====query subject_class("Todo", C), collection(C, Collection). =====result -[{"C":"c","Collection":"comments"},{"C":"c","Collection":"entries"},{"C":"c","Collection":"messages"},{"C":"c","Collection":"likedMessages"}] +[{"bindings":{"C":{"atom":"c"},"Collection":"comments"}},{"bindings":{"C":{"atom":"c"},"Collection":"entries"}},{"bindings":{"C":{"atom":"c"},"Collection":"messages"}},{"bindings":{"C":{"atom":"c"},"Collection":"likedMessages"}}] =====query subject_class("Todo", C), collection_adder(C, Collection, Adder). =====result -[{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]","C":"c","Collection":"commentss"},{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]","C":"c","Collection":"entriess"},{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]","C":"c","Collection":"messagess"},{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]","C":"c","Collection":"likedMessagess"}] +[{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"commentss"}},{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"entriess"}},{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"messagess"}},{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},"C":{"atom":"c"},"Collection":"likedMessagess"}}] =====query subject_class("Todo", C), collection_remover(C, Collection, Remover). =====result -[{"C":"c","Collection":"commentss","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"},{"C":"c","Collection":"entriess","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"messagess","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"likedMessagess","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"c"},"Collection":"commentss","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"entriess","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"messagess","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"likedMessagess","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}}] =====query subject_class("Todo", C), collection_setter(C, Collection, Setter). =====result -[{"C":"c","Collection":"commentss","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"},{"C":"c","Collection":"entriess","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"messagess","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"},{"C":"c","Collection":"likedMessagess","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"c"},"Collection":"commentss","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"todo://comment\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"entriess","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"messagess","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"c"},"Collection":"likedMessagess","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"flux://entry_type\", target: \"value\"}]"}}}] =====consult :- discontiguous(triple/3). :- discontiguous(link/5). @@ -5508,12 +5474,10 @@ property_getter(mqvvfluy, Base, "type", Value) :- triple(Base, "ad4m://type", Va property(mqvvfluy, "body"). property_getter(mqvvfluy, Base, "body", Value) :- triple(Base, "todo://state", Value). property_setter(mqvvfluy, "body", '[{action: "setSingleTarget", source: "this", predicate: "todo://state", target: "value"}]'). - - =====query subject_class("Todo", C), collection_getter(C, "literal://string:Collection%20where%20test", "entries", Value). =====result -[{"C":"c","Value":["literal://string:test%20message"]}] +[{"bindings":{"C":{"atom":"c"},"Value":["literal://string:test%20message"]}}] =====query subject_class("Todo", C), collection_getter(C, "literal://string:Collection%20where%20test", "messages", Value). =====result @@ -5521,11 +5485,11 @@ false =====query subject_class(Class, C), property(C, "type"), property(C, "body"), property_setter(C, "body", _). =====result -[{"C":"mqvvfluy","Class":"Message"}] +[{"bindings":{"C":{"atom":"mqvvfluy"},"Class":"Message"}}] =====query subject_class("Message", C), constructor(C, Actions). =====result -[{"Actions":"[{action: \"addLink\", source: \"this\", predicate: \"ad4m://type\", target: \"ad4m://message\"}, {action: \"addLink\", source: \"this\", predicate: \"todo://state\", target: \"todo://ready\"}]","C":"mqvvfluy"}] +[{"bindings":{"Actions":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"ad4m://type\", target: \"ad4m://message\"}, {action: \"addLink\", source: \"this\", predicate: \"todo://state\", target: \"todo://ready\"}]"},"C":{"atom":"mqvvfluy"}}}] =====consult :- discontiguous(triple/3). :- discontiguous(link/5). @@ -5748,28 +5712,26 @@ property_getter(mqvvfluy, Base, "type", Value) :- triple(Base, "ad4m://type", Va property(mqvvfluy, "body"). property_getter(mqvvfluy, Base, "body", Value) :- triple(Base, "todo://state", Value). property_setter(mqvvfluy, "body", '[{action: "setSingleTarget", source: "this", predicate: "todo://state", target: "value"}]'). - - =====query subject_class(Class, C), property(C, "type"), property(C, "body"), property_setter(C, "body", _). =====result -[{"C":"mqvvfluy","Class":"Message"}] +[{"bindings":{"C":{"atom":"mqvvfluy"},"Class":"Message"}}] =====query subject_class("Message", C), instance(C, "literal://string:test%20message"). =====result -[{"C":"mqvvfluy"}] +[{"bindings":{"C":{"atom":"mqvvfluy"}}}] =====query subject_class(Class, C), property(C, "type"), property(C, "body"), property_setter(C, "body", _). =====result -[{"C":"mqvvfluy","Class":"Message"}] +[{"bindings":{"C":{"atom":"mqvvfluy"},"Class":"Message"}}] =====query subject_class("Message", C), instance(C, "literal://string:test%20message"). =====result -[{"C":"mqvvfluy"}] +[{"bindings":{"C":{"atom":"mqvvfluy"}}}] =====query subject_class("Message", C), property(C, Property). =====result -[{"C":"mqvvfluy","Property":"type"},{"C":"mqvvfluy","Property":"body"}] +[{"bindings":{"C":{"atom":"mqvvfluy"},"Property":"type"}},{"bindings":{"C":{"atom":"mqvvfluy"},"Property":"body"}}] =====query subject_class("Message", C), property_resolve(C, "type"). =====result @@ -5781,7 +5743,7 @@ false =====query subject_class("Message", C), property_setter(C, Property, Setter). =====result -[{"C":"mqvvfluy","Property":"body","Setter":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://state\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"mqvvfluy"},"Property":"body","Setter":{"atom":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"todo://state\", target: \"value\"}]"}}}] =====query subject_class("Message", C), property_resolve_language(C, "body", Language). =====result @@ -5805,7 +5767,7 @@ false =====query subject_class("Todo", C), collection_getter(C, "literal://string:Collection%20where%20test", "messages", Value). =====result -[{"C":"c","Value":["literal://string:test%20message"]}] +[{"bindings":{"C":{"atom":"c"},"Value":["literal://string:test%20message"]}}] =====consult :- discontiguous(triple/3). :- discontiguous(link/5). @@ -6072,19 +6034,18 @@ collection_getter(nzkpcwbu, Base, "comments", List) :- findall(C, triple(Base, " collection_adder(nzkpcwbu, "commentss", '[{action: "addLink", source: "this", predicate: "recipe://comment", target: "value"}]'). collection_remover(nzkpcwbu, "commentss", '[{action: "removeLink", source: "this", predicate: "recipe://comment", target: "value"}]'). collection_setter(nzkpcwbu, "commentss", '[{action: "collectionSetter", source: "this", predicate: "recipe://comment", target: "value"}]'). - =====query subject_class(Class, C), property(C, "type"), property(C, "name"), property(C, "local"), property_setter(C, "name", _), property_setter(C, "local", _), collection_adder(C, "entriess", _), collection_adder(C, "ingredientss", _), collection_adder(C, "commentss", _), collection_remover(C, "entriess", _), collection_remover(C, "ingredientss", _), collection_remover(C, "commentss", _), collection_setter(C, "entriess", _), collection_setter(C, "ingredientss", _), collection_setter(C, "commentss", _). =====result -[{"C":"nzkpcwbu","Class":"Recipe"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Class":"Recipe"}}] =====query subject_class(Class, C), property(C, "type"), property(C, "name"), property(C, "local"), property_setter(C, "name", _), property_setter(C, "local", _), collection_adder(C, "entriess", _), collection_adder(C, "ingredientss", _), collection_adder(C, "commentss", _), collection_remover(C, "entriess", _), collection_remover(C, "ingredientss", _), collection_remover(C, "commentss", _), collection_setter(C, "entriess", _), collection_setter(C, "ingredientss", _), collection_setter(C, "commentss", _). =====result -[{"C":"nzkpcwbu","Class":"Recipe"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Class":"Recipe"}}] =====query subject_class("Recipe", C), constructor(C, Actions). =====result -[{"Actions":"[{action: \"addLink\", source: \"this\", predicate: \"ad4m://type\", target: \"ad4m://recipe\"}]","C":"nzkpcwbu"}] +[{"bindings":{"Actions":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"ad4m://type\", target: \"ad4m://recipe\"}]"},"C":{"atom":"nzkpcwbu"}}}] =====consult :- discontiguous(triple/3). :- discontiguous(link/5). @@ -6356,27 +6317,26 @@ collection_getter(nzkpcwbu, Base, "comments", List) :- findall(C, triple(Base, " collection_adder(nzkpcwbu, "commentss", '[{action: "addLink", source: "this", predicate: "recipe://comment", target: "value"}]'). collection_remover(nzkpcwbu, "commentss", '[{action: "removeLink", source: "this", predicate: "recipe://comment", target: "value"}]'). collection_setter(nzkpcwbu, "commentss", '[{action: "collectionSetter", source: "this", predicate: "recipe://comment", target: "value"}]'). - =====query subject_class(Class, C), property(C, "type"), property(C, "name"), property(C, "local"), property_setter(C, "name", _), property_setter(C, "local", _), collection_adder(C, "entriess", _), collection_adder(C, "ingredientss", _), collection_adder(C, "commentss", _), collection_remover(C, "entriess", _), collection_remover(C, "ingredientss", _), collection_remover(C, "commentss", _), collection_setter(C, "entriess", _), collection_setter(C, "ingredientss", _), collection_setter(C, "commentss", _). =====result -[{"C":"nzkpcwbu","Class":"Recipe"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Class":"Recipe"}}] =====query subject_class("Recipe", C), instance(C, "literal://string:Active%20record%20implementation%20test"). =====result -[{"C":"nzkpcwbu"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"}}}] =====query subject_class(Class, C), property(C, "type"), property(C, "name"), property(C, "local"), property_setter(C, "name", _), property_setter(C, "local", _), collection_adder(C, "entriess", _), collection_adder(C, "ingredientss", _), collection_adder(C, "commentss", _), collection_remover(C, "entriess", _), collection_remover(C, "ingredientss", _), collection_remover(C, "commentss", _), collection_setter(C, "entriess", _), collection_setter(C, "ingredientss", _), collection_setter(C, "commentss", _). =====result -[{"C":"nzkpcwbu","Class":"Recipe"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Class":"Recipe"}}] =====query subject_class("Recipe", C), instance(C, "literal://string:Active%20record%20implementation%20test"). =====result -[{"C":"nzkpcwbu"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"}}}] =====query subject_class("Recipe", C), property(C, Property). =====result -[{"C":"nzkpcwbu","Property":"type"},{"C":"nzkpcwbu","Property":"name"},{"C":"nzkpcwbu","Property":"local"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Property":"type"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Property":"name"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Property":"local"}}] =====query subject_class("Recipe", C), property_resolve(C, "type"). =====result @@ -6392,7 +6352,7 @@ false =====query subject_class("Recipe", C), property_setter(C, Property, Setter). =====result -[{"C":"nzkpcwbu","Property":"name","Setter":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"recipe://name\", target: \"value\"}]"},{"C":"nzkpcwbu","Property":"local","Setter":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"recipe://local\", target: \"value\", local: true}]"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Property":"name","Setter":{"atom":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"recipe://name\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Property":"local","Setter":{"atom":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"recipe://local\", target: \"value\", local: true}]"}}}] =====query subject_class("Recipe", C), property_resolve_language(C, "name", Language). =====result @@ -6404,19 +6364,19 @@ false =====query subject_class("Recipe", C), collection(C, Collection). =====result -[{"C":"nzkpcwbu","Collection":"entries"},{"C":"nzkpcwbu","Collection":"ingredients"},{"C":"nzkpcwbu","Collection":"comments"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"entries"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"ingredients"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"comments"}}] =====query subject_class("Recipe", C), collection_adder(C, Collection, Adder). =====result -[{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"recipe://entries\", target: \"value\"}]","C":"nzkpcwbu","Collection":"entriess"},{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"recipe://entries\", target: \"value\"}]","C":"nzkpcwbu","Collection":"ingredientss"},{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"recipe://comment\", target: \"value\"}]","C":"nzkpcwbu","Collection":"commentss"}] +[{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"recipe://entries\", target: \"value\"}]"},"C":{"atom":"nzkpcwbu"},"Collection":"entriess"}},{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"recipe://entries\", target: \"value\"}]"},"C":{"atom":"nzkpcwbu"},"Collection":"ingredientss"}},{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"recipe://comment\", target: \"value\"}]"},"C":{"atom":"nzkpcwbu"},"Collection":"commentss"}}] =====query subject_class("Recipe", C), collection_remover(C, Collection, Remover). =====result -[{"C":"nzkpcwbu","Collection":"entriess","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"recipe://entries\", target: \"value\"}]"},{"C":"nzkpcwbu","Collection":"ingredientss","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"recipe://entries\", target: \"value\"}]"},{"C":"nzkpcwbu","Collection":"commentss","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"recipe://comment\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"entriess","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"recipe://entries\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"ingredientss","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"recipe://entries\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"commentss","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"recipe://comment\", target: \"value\"}]"}}}] =====query subject_class("Recipe", C), collection_setter(C, Collection, Setter). =====result -[{"C":"nzkpcwbu","Collection":"entriess","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"recipe://entries\", target: \"value\"}]"},{"C":"nzkpcwbu","Collection":"ingredientss","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"recipe://entries\", target: \"value\"}]"},{"C":"nzkpcwbu","Collection":"commentss","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"recipe://comment\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"entriess","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"recipe://entries\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"ingredientss","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"recipe://entries\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"commentss","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"recipe://comment\", target: \"value\"}]"}}}] =====consult :- discontiguous(triple/3). :- discontiguous(link/5). @@ -6690,15 +6650,14 @@ collection_getter(nzkpcwbu, Base, "comments", List) :- findall(C, triple(Base, " collection_adder(nzkpcwbu, "commentss", '[{action: "addLink", source: "this", predicate: "recipe://comment", target: "value"}]'). collection_remover(nzkpcwbu, "commentss", '[{action: "removeLink", source: "this", predicate: "recipe://comment", target: "value"}]'). collection_setter(nzkpcwbu, "commentss", '[{action: "collectionSetter", source: "this", predicate: "recipe://comment", target: "value"}]'). - =====query subject_class(Class, C), property(C, "type"), property(C, "name"), property(C, "local"), property_setter(C, "name", _), property_setter(C, "local", _), collection_adder(C, "entriess", _), collection_adder(C, "ingredientss", _), collection_adder(C, "commentss", _), collection_remover(C, "entriess", _), collection_remover(C, "ingredientss", _), collection_remover(C, "commentss", _), collection_setter(C, "entriess", _), collection_setter(C, "ingredientss", _), collection_setter(C, "commentss", _). =====result -[{"C":"nzkpcwbu","Class":"Recipe"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Class":"Recipe"}}] =====query subject_class("Recipe", C), property_setter(C, "name", Setter). =====result -[{"C":"nzkpcwbu","Setter":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"recipe://name\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Setter":{"atom":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"recipe://name\", target: \"value\"}]"}}}] =====query subject_class("Recipe", C), property_resolve_language(C, "name", Language). =====result @@ -6978,7 +6937,6 @@ collection_getter(nzkpcwbu, Base, "comments", List) :- findall(C, triple(Base, " collection_adder(nzkpcwbu, "commentss", '[{action: "addLink", source: "this", predicate: "recipe://comment", target: "value"}]'). collection_remover(nzkpcwbu, "commentss", '[{action: "removeLink", source: "this", predicate: "recipe://comment", target: "value"}]'). collection_setter(nzkpcwbu, "commentss", '[{action: "collectionSetter", source: "this", predicate: "recipe://comment", target: "value"}]'). - =====query subject_class("Recipe", C), property_setter(C, "entries", Setter). =====result @@ -6990,11 +6948,11 @@ false =====query subject_class("Recipe", C), instance(C, "literal://string:Active%20record%20implementation%20test"). =====result -[{"C":"nzkpcwbu"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"}}}] =====query subject_class("Recipe", C), property(C, Property). =====result -[{"C":"nzkpcwbu","Property":"type"},{"C":"nzkpcwbu","Property":"name"},{"C":"nzkpcwbu","Property":"local"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Property":"type"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Property":"name"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Property":"local"}}] =====query subject_class("Recipe", C), property_resolve(C, "type"). =====result @@ -7002,7 +6960,7 @@ false =====query subject_class("Recipe", C), property_getter(C, "literal://string:Active%20record%20implementation%20test", "type", Value). =====result -[{"C":"nzkpcwbu","Value":"ad4m://recipe"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":"ad4m://recipe"}}] =====query subject_class("Recipe", C), property_resolve(C, "name"). =====result @@ -7010,7 +6968,7 @@ false =====query subject_class("Recipe", C), property_getter(C, "literal://string:Active%20record%20implementation%20test", "name", Value). =====result -[{"C":"nzkpcwbu","Value":"recipe://test"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":"recipe://test"}}] =====query subject_class("Recipe", C), property_resolve(C, "local"). =====result @@ -7022,11 +6980,11 @@ false =====query subject_class("Recipe", C), collection(C, Collection). =====result -[{"C":"nzkpcwbu","Collection":"entries"},{"C":"nzkpcwbu","Collection":"ingredients"},{"C":"nzkpcwbu","Collection":"comments"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"entries"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"ingredients"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"comments"}}] =====query subject_class("Recipe", C), collection_getter(C, "literal://string:Active%20record%20implementation%20test", "entries", Value). =====result -[{"C":"nzkpcwbu","Value":[""]}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":[]}}] =====query subject_class("Recipe", C), collection_getter(C, "literal://string:Active%20record%20implementation%20test", "ingredients", Value). =====result @@ -7034,19 +6992,19 @@ false =====query subject_class("Recipe", C), collection_getter(C, "literal://string:Active%20record%20implementation%20test", "comments", Value). =====result -[{"C":"nzkpcwbu","Value":[""]}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":[]}}] =====query subject_class(Class, C), property(C, "type"), property(C, "name"), property(C, "local"), property_setter(C, "name", _), property_setter(C, "local", _), collection_adder(C, "entriess", _), collection_adder(C, "ingredientss", _), collection_adder(C, "commentss", _), collection_remover(C, "entriess", _), collection_remover(C, "ingredientss", _), collection_remover(C, "commentss", _), collection_setter(C, "entriess", _), collection_setter(C, "ingredientss", _), collection_setter(C, "commentss", _). =====result -[{"C":"nzkpcwbu","Class":"Recipe"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Class":"Recipe"}}] =====query subject_class("Recipe", C), instance(C, "literal://string:Active%20record%20implementation%20test"). =====result -[{"C":"nzkpcwbu"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"}}}] =====query subject_class("Recipe", C), property(C, Property). =====result -[{"C":"nzkpcwbu","Property":"type"},{"C":"nzkpcwbu","Property":"name"},{"C":"nzkpcwbu","Property":"local"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Property":"type"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Property":"name"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Property":"local"}}] =====query subject_class("Recipe", C), property_resolve(C, "type"). =====result @@ -7054,7 +7012,7 @@ false =====query subject_class("Recipe", C), property_getter(C, "literal://string:Active%20record%20implementation%20test", "type", Value). =====result -[{"C":"nzkpcwbu","Value":"ad4m://recipe"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":"ad4m://recipe"}}] =====query subject_class("Recipe", C), property_resolve(C, "name"). =====result @@ -7062,7 +7020,7 @@ false =====query subject_class("Recipe", C), property_getter(C, "literal://string:Active%20record%20implementation%20test", "name", Value). =====result -[{"C":"nzkpcwbu","Value":"recipe://test"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":"recipe://test"}}] =====query subject_class("Recipe", C), property_resolve(C, "local"). =====result @@ -7074,11 +7032,11 @@ false =====query subject_class("Recipe", C), collection(C, Collection). =====result -[{"C":"nzkpcwbu","Collection":"entries"},{"C":"nzkpcwbu","Collection":"ingredients"},{"C":"nzkpcwbu","Collection":"comments"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"entries"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"ingredients"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"comments"}}] =====query subject_class("Recipe", C), collection_getter(C, "literal://string:Active%20record%20implementation%20test", "entries", Value). =====result -[{"C":"nzkpcwbu","Value":[""]}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":[]}}] =====query subject_class("Recipe", C), collection_getter(C, "literal://string:Active%20record%20implementation%20test", "ingredients", Value). =====result @@ -7086,15 +7044,15 @@ false =====query subject_class("Recipe", C), collection_getter(C, "literal://string:Active%20record%20implementation%20test", "comments", Value). =====result -[{"C":"nzkpcwbu","Value":[""]}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":[]}}] =====query subject_class(Class, C), property(C, "type"), property(C, "name"), property(C, "local"), property_setter(C, "name", _), property_setter(C, "local", _), collection_adder(C, "entriess", _), collection_adder(C, "ingredientss", _), collection_adder(C, "commentss", _), collection_remover(C, "entriess", _), collection_remover(C, "ingredientss", _), collection_remover(C, "commentss", _), collection_setter(C, "entriess", _), collection_setter(C, "ingredientss", _), collection_setter(C, "commentss", _). =====result -[{"C":"nzkpcwbu","Class":"Recipe"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Class":"Recipe"}}] =====query subject_class("Recipe", C), property_setter(C, "name", Setter). =====result -[{"C":"nzkpcwbu","Setter":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"recipe://name\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Setter":{"atom":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"recipe://name\", target: \"value\"}]"}}}] =====query subject_class("Recipe", C), property_resolve_language(C, "name", Language). =====result @@ -7374,7 +7332,6 @@ collection_getter(nzkpcwbu, Base, "comments", List) :- findall(C, triple(Base, " collection_adder(nzkpcwbu, "commentss", '[{action: "addLink", source: "this", predicate: "recipe://comment", target: "value"}]'). collection_remover(nzkpcwbu, "commentss", '[{action: "removeLink", source: "this", predicate: "recipe://comment", target: "value"}]'). collection_setter(nzkpcwbu, "commentss", '[{action: "collectionSetter", source: "this", predicate: "recipe://comment", target: "value"}]'). - =====query subject_class("Recipe", C), property_setter(C, "entries", Setter). =====result @@ -7386,11 +7343,11 @@ false =====query subject_class("Recipe", C), instance(C, "literal://string:Active%20record%20implementation%20test"). =====result -[{"C":"nzkpcwbu"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"}}}] =====query subject_class("Recipe", C), property(C, Property). =====result -[{"C":"nzkpcwbu","Property":"type"},{"C":"nzkpcwbu","Property":"name"},{"C":"nzkpcwbu","Property":"local"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Property":"type"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Property":"name"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Property":"local"}}] =====query subject_class("Recipe", C), property_resolve(C, "type"). =====result @@ -7398,7 +7355,7 @@ false =====query subject_class("Recipe", C), property_getter(C, "literal://string:Active%20record%20implementation%20test", "type", Value). =====result -[{"C":"nzkpcwbu","Value":"ad4m://recipe"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":"ad4m://recipe"}}] =====query subject_class("Recipe", C), property_resolve(C, "name"). =====result @@ -7406,7 +7363,7 @@ false =====query subject_class("Recipe", C), property_getter(C, "literal://string:Active%20record%20implementation%20test", "name", Value). =====result -[{"C":"nzkpcwbu","Value":"recipe://test1"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":"recipe://test1"}}] =====query subject_class("Recipe", C), property_resolve(C, "local"). =====result @@ -7418,11 +7375,11 @@ false =====query subject_class("Recipe", C), collection(C, Collection). =====result -[{"C":"nzkpcwbu","Collection":"entries"},{"C":"nzkpcwbu","Collection":"ingredients"},{"C":"nzkpcwbu","Collection":"comments"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"entries"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"ingredients"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"comments"}}] =====query subject_class("Recipe", C), collection_getter(C, "literal://string:Active%20record%20implementation%20test", "entries", Value). =====result -[{"C":"nzkpcwbu","Value":[""]}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":[]}}] =====query subject_class("Recipe", C), collection_getter(C, "literal://string:Active%20record%20implementation%20test", "ingredients", Value). =====result @@ -7430,19 +7387,19 @@ false =====query subject_class("Recipe", C), collection_getter(C, "literal://string:Active%20record%20implementation%20test", "comments", Value). =====result -[{"C":"nzkpcwbu","Value":[""]}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":[]}}] =====query subject_class(Class, C), property(C, "type"), property(C, "name"), property(C, "local"), property_setter(C, "name", _), property_setter(C, "local", _), collection_adder(C, "entriess", _), collection_adder(C, "ingredientss", _), collection_adder(C, "commentss", _), collection_remover(C, "entriess", _), collection_remover(C, "ingredientss", _), collection_remover(C, "commentss", _), collection_setter(C, "entriess", _), collection_setter(C, "ingredientss", _), collection_setter(C, "commentss", _). =====result -[{"C":"nzkpcwbu","Class":"Recipe"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Class":"Recipe"}}] =====query subject_class("Recipe", C), instance(C, "literal://string:Active%20record%20implementation%20test"). =====result -[{"C":"nzkpcwbu"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"}}}] =====query subject_class("Recipe", C), property(C, Property). =====result -[{"C":"nzkpcwbu","Property":"type"},{"C":"nzkpcwbu","Property":"name"},{"C":"nzkpcwbu","Property":"local"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Property":"type"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Property":"name"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Property":"local"}}] =====query subject_class("Recipe", C), property_resolve(C, "type"). =====result @@ -7450,7 +7407,7 @@ false =====query subject_class("Recipe", C), property_getter(C, "literal://string:Active%20record%20implementation%20test", "type", Value). =====result -[{"C":"nzkpcwbu","Value":"ad4m://recipe"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":"ad4m://recipe"}}] =====query subject_class("Recipe", C), property_resolve(C, "name"). =====result @@ -7458,7 +7415,7 @@ false =====query subject_class("Recipe", C), property_getter(C, "literal://string:Active%20record%20implementation%20test", "name", Value). =====result -[{"C":"nzkpcwbu","Value":"recipe://test1"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":"recipe://test1"}}] =====query subject_class("Recipe", C), property_resolve(C, "local"). =====result @@ -7470,11 +7427,11 @@ false =====query subject_class("Recipe", C), collection(C, Collection). =====result -[{"C":"nzkpcwbu","Collection":"entries"},{"C":"nzkpcwbu","Collection":"ingredients"},{"C":"nzkpcwbu","Collection":"comments"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"entries"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"ingredients"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"comments"}}] =====query subject_class("Recipe", C), collection_getter(C, "literal://string:Active%20record%20implementation%20test", "entries", Value). =====result -[{"C":"nzkpcwbu","Value":[""]}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":[]}}] =====query subject_class("Recipe", C), collection_getter(C, "literal://string:Active%20record%20implementation%20test", "ingredients", Value). =====result @@ -7482,7 +7439,7 @@ false =====query subject_class("Recipe", C), collection_getter(C, "literal://string:Active%20record%20implementation%20test", "comments", Value). =====result -[{"C":"nzkpcwbu","Value":[""]}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":[]}}] =====query subject_class(Class, C), property(C, "className"), property(C, "generateSDNA"). =====result @@ -7490,19 +7447,19 @@ false =====query subject_class("Recipe", C), instance(C, X). =====result -[{"C":"nzkpcwbu","X":"literal://string:Active%20record%20implementation%20test"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"X":"literal://string:Active%20record%20implementation%20test"}}] =====query subject_class(Class, C), property(C, "type"), property(C, "name"), property(C, "local"), property_setter(C, "name", _), property_setter(C, "local", _), collection_adder(C, "entriess", _), collection_adder(C, "ingredientss", _), collection_adder(C, "commentss", _), collection_remover(C, "entriess", _), collection_remover(C, "ingredientss", _), collection_remover(C, "commentss", _), collection_setter(C, "entriess", _), collection_setter(C, "ingredientss", _), collection_setter(C, "commentss", _). =====result -[{"C":"nzkpcwbu","Class":"Recipe"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Class":"Recipe"}}] =====query subject_class("Recipe", C), instance(C, "literal://string:Active%20record%20implementation%20test"). =====result -[{"C":"nzkpcwbu"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"}}}] =====query subject_class("Recipe", C), property(C, Property). =====result -[{"C":"nzkpcwbu","Property":"type"},{"C":"nzkpcwbu","Property":"name"},{"C":"nzkpcwbu","Property":"local"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Property":"type"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Property":"name"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Property":"local"}}] =====query subject_class("Recipe", C), property_resolve(C, "type"). =====result @@ -7510,7 +7467,7 @@ false =====query subject_class("Recipe", C), property_getter(C, "literal://string:Active%20record%20implementation%20test", "type", Value). =====result -[{"C":"nzkpcwbu","Value":"ad4m://recipe"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":"ad4m://recipe"}}] =====query subject_class("Recipe", C), property_resolve(C, "name"). =====result @@ -7518,7 +7475,7 @@ false =====query subject_class("Recipe", C), property_getter(C, "literal://string:Active%20record%20implementation%20test", "name", Value). =====result -[{"C":"nzkpcwbu","Value":"recipe://test1"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":"recipe://test1"}}] =====query subject_class("Recipe", C), property_resolve(C, "local"). =====result @@ -7530,11 +7487,11 @@ false =====query subject_class("Recipe", C), collection(C, Collection). =====result -[{"C":"nzkpcwbu","Collection":"entries"},{"C":"nzkpcwbu","Collection":"ingredients"},{"C":"nzkpcwbu","Collection":"comments"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"entries"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"ingredients"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"comments"}}] =====query subject_class("Recipe", C), collection_getter(C, "literal://string:Active%20record%20implementation%20test", "entries", Value). =====result -[{"C":"nzkpcwbu","Value":[""]}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":[]}}] =====query subject_class("Recipe", C), collection_getter(C, "literal://string:Active%20record%20implementation%20test", "ingredients", Value). =====result @@ -7542,19 +7499,19 @@ false =====query subject_class("Recipe", C), collection_getter(C, "literal://string:Active%20record%20implementation%20test", "comments", Value). =====result -[{"C":"nzkpcwbu","Value":[""]}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":[]}}] =====query subject_class(Class, C), property(C, "type"), property(C, "name"), property(C, "local"), property_setter(C, "name", _), property_setter(C, "local", _), collection_adder(C, "entriess", _), collection_adder(C, "ingredientss", _), collection_adder(C, "commentss", _), collection_remover(C, "entriess", _), collection_remover(C, "ingredientss", _), collection_remover(C, "commentss", _), collection_setter(C, "entriess", _), collection_setter(C, "ingredientss", _), collection_setter(C, "commentss", _). =====result -[{"C":"nzkpcwbu","Class":"Recipe"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Class":"Recipe"}}] =====query subject_class(Class, C), property(C, "type"), property(C, "name"), property(C, "local"), property_setter(C, "name", _), property_setter(C, "local", _), collection_adder(C, "entriess", _), collection_adder(C, "ingredientss", _), collection_adder(C, "commentss", _), collection_remover(C, "entriess", _), collection_remover(C, "ingredientss", _), collection_remover(C, "commentss", _), collection_setter(C, "entriess", _), collection_setter(C, "ingredientss", _), collection_setter(C, "commentss", _). =====result -[{"C":"nzkpcwbu","Class":"Recipe"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Class":"Recipe"}}] =====query subject_class("Recipe", C), constructor(C, Actions). =====result -[{"Actions":"[{action: \"addLink\", source: \"this\", predicate: \"ad4m://type\", target: \"ad4m://recipe\"}]","C":"nzkpcwbu"}] +[{"bindings":{"Actions":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"ad4m://type\", target: \"ad4m://recipe\"}]"},"C":{"atom":"nzkpcwbu"}}}] =====consult :- discontiguous(triple/3). :- discontiguous(link/5). @@ -7835,27 +7792,26 @@ collection_getter(nzkpcwbu, Base, "comments", List) :- findall(C, triple(Base, " collection_adder(nzkpcwbu, "commentss", '[{action: "addLink", source: "this", predicate: "recipe://comment", target: "value"}]'). collection_remover(nzkpcwbu, "commentss", '[{action: "removeLink", source: "this", predicate: "recipe://comment", target: "value"}]'). collection_setter(nzkpcwbu, "commentss", '[{action: "collectionSetter", source: "this", predicate: "recipe://comment", target: "value"}]'). - =====query subject_class(Class, C), property(C, "type"), property(C, "name"), property(C, "local"), property_setter(C, "name", _), property_setter(C, "local", _), collection_adder(C, "entriess", _), collection_adder(C, "ingredientss", _), collection_adder(C, "commentss", _), collection_remover(C, "entriess", _), collection_remover(C, "ingredientss", _), collection_remover(C, "commentss", _), collection_setter(C, "entriess", _), collection_setter(C, "ingredientss", _), collection_setter(C, "commentss", _). =====result -[{"C":"nzkpcwbu","Class":"Recipe"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Class":"Recipe"}}] =====query subject_class("Recipe", C), instance(C, "literal://string:Active%20record%20implementation%20collection%20test"). =====result -[{"C":"nzkpcwbu"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"}}}] =====query subject_class(Class, C), property(C, "type"), property(C, "name"), property(C, "local"), property_setter(C, "name", _), property_setter(C, "local", _), collection_adder(C, "entriess", _), collection_adder(C, "ingredientss", _), collection_adder(C, "commentss", _), collection_remover(C, "entriess", _), collection_remover(C, "ingredientss", _), collection_remover(C, "commentss", _), collection_setter(C, "entriess", _), collection_setter(C, "ingredientss", _), collection_setter(C, "commentss", _). =====result -[{"C":"nzkpcwbu","Class":"Recipe"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Class":"Recipe"}}] =====query subject_class("Recipe", C), instance(C, "literal://string:Active%20record%20implementation%20collection%20test"). =====result -[{"C":"nzkpcwbu"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"}}}] =====query subject_class("Recipe", C), property(C, Property). =====result -[{"C":"nzkpcwbu","Property":"type"},{"C":"nzkpcwbu","Property":"name"},{"C":"nzkpcwbu","Property":"local"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Property":"type"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Property":"name"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Property":"local"}}] =====query subject_class("Recipe", C), property_resolve(C, "type"). =====result @@ -7871,7 +7827,7 @@ false =====query subject_class("Recipe", C), property_setter(C, Property, Setter). =====result -[{"C":"nzkpcwbu","Property":"name","Setter":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"recipe://name\", target: \"value\"}]"},{"C":"nzkpcwbu","Property":"local","Setter":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"recipe://local\", target: \"value\", local: true}]"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Property":"name","Setter":{"atom":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"recipe://name\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Property":"local","Setter":{"atom":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"recipe://local\", target: \"value\", local: true}]"}}}] =====query subject_class("Recipe", C), property_resolve_language(C, "name", Language). =====result @@ -7883,19 +7839,19 @@ false =====query subject_class("Recipe", C), collection(C, Collection). =====result -[{"C":"nzkpcwbu","Collection":"entries"},{"C":"nzkpcwbu","Collection":"ingredients"},{"C":"nzkpcwbu","Collection":"comments"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"entries"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"ingredients"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"comments"}}] =====query subject_class("Recipe", C), collection_adder(C, Collection, Adder). =====result -[{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"recipe://entries\", target: \"value\"}]","C":"nzkpcwbu","Collection":"entriess"},{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"recipe://entries\", target: \"value\"}]","C":"nzkpcwbu","Collection":"ingredientss"},{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"recipe://comment\", target: \"value\"}]","C":"nzkpcwbu","Collection":"commentss"}] +[{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"recipe://entries\", target: \"value\"}]"},"C":{"atom":"nzkpcwbu"},"Collection":"entriess"}},{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"recipe://entries\", target: \"value\"}]"},"C":{"atom":"nzkpcwbu"},"Collection":"ingredientss"}},{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"recipe://comment\", target: \"value\"}]"},"C":{"atom":"nzkpcwbu"},"Collection":"commentss"}}] =====query subject_class("Recipe", C), collection_remover(C, Collection, Remover). =====result -[{"C":"nzkpcwbu","Collection":"entriess","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"recipe://entries\", target: \"value\"}]"},{"C":"nzkpcwbu","Collection":"ingredientss","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"recipe://entries\", target: \"value\"}]"},{"C":"nzkpcwbu","Collection":"commentss","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"recipe://comment\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"entriess","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"recipe://entries\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"ingredientss","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"recipe://entries\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"commentss","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"recipe://comment\", target: \"value\"}]"}}}] =====query subject_class("Recipe", C), collection_setter(C, Collection, Setter). =====result -[{"C":"nzkpcwbu","Collection":"entriess","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"recipe://entries\", target: \"value\"}]"},{"C":"nzkpcwbu","Collection":"ingredientss","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"recipe://entries\", target: \"value\"}]"},{"C":"nzkpcwbu","Collection":"commentss","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"recipe://comment\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"entriess","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"recipe://entries\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"ingredientss","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"recipe://entries\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"commentss","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"recipe://comment\", target: \"value\"}]"}}}] =====consult :- discontiguous(triple/3). :- discontiguous(link/5). @@ -8178,15 +8134,14 @@ collection_getter(nzkpcwbu, Base, "comments", List) :- findall(C, triple(Base, " collection_adder(nzkpcwbu, "commentss", '[{action: "addLink", source: "this", predicate: "recipe://comment", target: "value"}]'). collection_remover(nzkpcwbu, "commentss", '[{action: "removeLink", source: "this", predicate: "recipe://comment", target: "value"}]'). collection_setter(nzkpcwbu, "commentss", '[{action: "collectionSetter", source: "this", predicate: "recipe://comment", target: "value"}]'). - =====query subject_class(Class, C), property(C, "type"), property(C, "name"), property(C, "local"), property_setter(C, "name", _), property_setter(C, "local", _), collection_adder(C, "entriess", _), collection_adder(C, "ingredientss", _), collection_adder(C, "commentss", _), collection_remover(C, "entriess", _), collection_remover(C, "ingredientss", _), collection_remover(C, "commentss", _), collection_setter(C, "entriess", _), collection_setter(C, "ingredientss", _), collection_setter(C, "commentss", _). =====result -[{"C":"nzkpcwbu","Class":"Recipe"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Class":"Recipe"}}] =====query subject_class("Recipe", C), property_setter(C, "name", Setter). =====result -[{"C":"nzkpcwbu","Setter":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"recipe://name\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Setter":{"atom":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"recipe://name\", target: \"value\"}]"}}}] =====query subject_class("Recipe", C), property_resolve_language(C, "name", Language). =====result @@ -8475,7 +8430,6 @@ collection_getter(nzkpcwbu, Base, "comments", List) :- findall(C, triple(Base, " collection_adder(nzkpcwbu, "commentss", '[{action: "addLink", source: "this", predicate: "recipe://comment", target: "value"}]'). collection_remover(nzkpcwbu, "commentss", '[{action: "removeLink", source: "this", predicate: "recipe://comment", target: "value"}]'). collection_setter(nzkpcwbu, "commentss", '[{action: "collectionSetter", source: "this", predicate: "recipe://comment", target: "value"}]'). - =====query subject_class("Recipe", C), property_setter(C, "entries", Setter). =====result @@ -8483,7 +8437,7 @@ false =====query subject_class("Recipe", C), collection_setter(C, "commentss", Setter). =====result -[{"C":"nzkpcwbu","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"recipe://comment\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"recipe://comment\", target: \"value\"}]"}}}] =====consult :- discontiguous(triple/3). :- discontiguous(link/5). @@ -8772,15 +8726,14 @@ collection_getter(nzkpcwbu, Base, "comments", List) :- findall(C, triple(Base, " collection_adder(nzkpcwbu, "commentss", '[{action: "addLink", source: "this", predicate: "recipe://comment", target: "value"}]'). collection_remover(nzkpcwbu, "commentss", '[{action: "removeLink", source: "this", predicate: "recipe://comment", target: "value"}]'). collection_setter(nzkpcwbu, "commentss", '[{action: "collectionSetter", source: "this", predicate: "recipe://comment", target: "value"}]'). - =====query subject_class("Recipe", C), instance(C, "literal://string:Active%20record%20implementation%20collection%20test"). =====result -[{"C":"nzkpcwbu"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"}}}] =====query subject_class("Recipe", C), property(C, Property). =====result -[{"C":"nzkpcwbu","Property":"type"},{"C":"nzkpcwbu","Property":"name"},{"C":"nzkpcwbu","Property":"local"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Property":"type"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Property":"name"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Property":"local"}}] =====query subject_class("Recipe", C), property_resolve(C, "type"). =====result @@ -8788,7 +8741,7 @@ false =====query subject_class("Recipe", C), property_getter(C, "literal://string:Active%20record%20implementation%20collection%20test", "type", Value). =====result -[{"C":"nzkpcwbu","Value":"ad4m://recipe"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":"ad4m://recipe"}}] =====query subject_class("Recipe", C), property_resolve(C, "name"). =====result @@ -8796,7 +8749,7 @@ false =====query subject_class("Recipe", C), property_getter(C, "literal://string:Active%20record%20implementation%20collection%20test", "name", Value). =====result -[{"C":"nzkpcwbu","Value":"recipe://collection_test"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":"recipe://collection_test"}}] =====query subject_class("Recipe", C), property_resolve(C, "local"). =====result @@ -8808,11 +8761,11 @@ false =====query subject_class("Recipe", C), collection(C, Collection). =====result -[{"C":"nzkpcwbu","Collection":"entries"},{"C":"nzkpcwbu","Collection":"ingredients"},{"C":"nzkpcwbu","Collection":"comments"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"entries"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"ingredients"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"comments"}}] =====query subject_class("Recipe", C), collection_getter(C, "literal://string:Active%20record%20implementation%20collection%20test", "entries", Value). =====result -[{"C":"nzkpcwbu","Value":[""]}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":[]}}] =====query subject_class("Recipe", C), collection_getter(C, "literal://string:Active%20record%20implementation%20collection%20test", "ingredients", Value). =====result @@ -8820,19 +8773,19 @@ false =====query subject_class("Recipe", C), collection_getter(C, "literal://string:Active%20record%20implementation%20collection%20test", "comments", Value). =====result -[{"C":"nzkpcwbu","Value":["recipe://test","recipe://test1"]}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":["recipe://test","recipe://test1"]}}] =====query subject_class(Class, C), property(C, "type"), property(C, "name"), property(C, "local"), property_setter(C, "name", _), property_setter(C, "local", _), collection_adder(C, "entriess", _), collection_adder(C, "ingredientss", _), collection_adder(C, "commentss", _), collection_remover(C, "entriess", _), collection_remover(C, "ingredientss", _), collection_remover(C, "commentss", _), collection_setter(C, "entriess", _), collection_setter(C, "ingredientss", _), collection_setter(C, "commentss", _). =====result -[{"C":"nzkpcwbu","Class":"Recipe"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Class":"Recipe"}}] =====query subject_class("Recipe", C), instance(C, "literal://string:Active%20record%20implementation%20collection%20test"). =====result -[{"C":"nzkpcwbu"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"}}}] =====query subject_class("Recipe", C), property(C, Property). =====result -[{"C":"nzkpcwbu","Property":"type"},{"C":"nzkpcwbu","Property":"name"},{"C":"nzkpcwbu","Property":"local"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Property":"type"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Property":"name"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Property":"local"}}] =====query subject_class("Recipe", C), property_resolve(C, "type"). =====result @@ -8840,7 +8793,7 @@ false =====query subject_class("Recipe", C), property_getter(C, "literal://string:Active%20record%20implementation%20collection%20test", "type", Value). =====result -[{"C":"nzkpcwbu","Value":"ad4m://recipe"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":"ad4m://recipe"}}] =====query subject_class("Recipe", C), property_resolve(C, "name"). =====result @@ -8848,7 +8801,7 @@ false =====query subject_class("Recipe", C), property_getter(C, "literal://string:Active%20record%20implementation%20collection%20test", "name", Value). =====result -[{"C":"nzkpcwbu","Value":"recipe://collection_test"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":"recipe://collection_test"}}] =====query subject_class("Recipe", C), property_resolve(C, "local"). =====result @@ -8860,11 +8813,11 @@ false =====query subject_class("Recipe", C), collection(C, Collection). =====result -[{"C":"nzkpcwbu","Collection":"entries"},{"C":"nzkpcwbu","Collection":"ingredients"},{"C":"nzkpcwbu","Collection":"comments"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"entries"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"ingredients"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"comments"}}] =====query subject_class("Recipe", C), collection_getter(C, "literal://string:Active%20record%20implementation%20collection%20test", "entries", Value). =====result -[{"C":"nzkpcwbu","Value":[""]}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":[]}}] =====query subject_class("Recipe", C), collection_getter(C, "literal://string:Active%20record%20implementation%20collection%20test", "ingredients", Value). =====result @@ -8872,19 +8825,19 @@ false =====query subject_class("Recipe", C), collection_getter(C, "literal://string:Active%20record%20implementation%20collection%20test", "comments", Value). =====result -[{"C":"nzkpcwbu","Value":["recipe://test","recipe://test1"]}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":["recipe://test","recipe://test1"]}}] =====query subject_class(Class, C), property(C, "type"), property(C, "name"), property(C, "local"), property_setter(C, "name", _), property_setter(C, "local", _), collection_adder(C, "entriess", _), collection_adder(C, "ingredientss", _), collection_adder(C, "commentss", _), collection_remover(C, "entriess", _), collection_remover(C, "ingredientss", _), collection_remover(C, "commentss", _), collection_setter(C, "entriess", _), collection_setter(C, "ingredientss", _), collection_setter(C, "commentss", _). =====result -[{"C":"nzkpcwbu","Class":"Recipe"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Class":"Recipe"}}] =====query subject_class(Class, C), property(C, "type"), property(C, "name"), property(C, "local"), property_setter(C, "name", _), property_setter(C, "local", _), collection_adder(C, "entriess", _), collection_adder(C, "ingredientss", _), collection_adder(C, "commentss", _), collection_remover(C, "entriess", _), collection_remover(C, "ingredientss", _), collection_remover(C, "commentss", _), collection_setter(C, "entriess", _), collection_setter(C, "ingredientss", _), collection_setter(C, "commentss", _). =====result -[{"C":"nzkpcwbu","Class":"Recipe"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Class":"Recipe"}}] =====query subject_class("Recipe", C), constructor(C, Actions). =====result -[{"Actions":"[{action: \"addLink\", source: \"this\", predicate: \"ad4m://type\", target: \"ad4m://recipe\"}]","C":"nzkpcwbu"}] +[{"bindings":{"Actions":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"ad4m://type\", target: \"ad4m://recipe\"}]"},"C":{"atom":"nzkpcwbu"}}}] =====consult :- discontiguous(triple/3). :- discontiguous(link/5). @@ -9178,27 +9131,26 @@ collection_getter(nzkpcwbu, Base, "comments", List) :- findall(C, triple(Base, " collection_adder(nzkpcwbu, "commentss", '[{action: "addLink", source: "this", predicate: "recipe://comment", target: "value"}]'). collection_remover(nzkpcwbu, "commentss", '[{action: "removeLink", source: "this", predicate: "recipe://comment", target: "value"}]'). collection_setter(nzkpcwbu, "commentss", '[{action: "collectionSetter", source: "this", predicate: "recipe://comment", target: "value"}]'). - =====query subject_class(Class, C), property(C, "type"), property(C, "name"), property(C, "local"), property_setter(C, "name", _), property_setter(C, "local", _), collection_adder(C, "entriess", _), collection_adder(C, "ingredientss", _), collection_adder(C, "commentss", _), collection_remover(C, "entriess", _), collection_remover(C, "ingredientss", _), collection_remover(C, "commentss", _), collection_setter(C, "entriess", _), collection_setter(C, "ingredientss", _), collection_setter(C, "commentss", _). =====result -[{"C":"nzkpcwbu","Class":"Recipe"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Class":"Recipe"}}] =====query subject_class("Recipe", C), instance(C, "literal://string:Active%20record%20implementation%20test%20local%20link"). =====result -[{"C":"nzkpcwbu"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"}}}] =====query subject_class(Class, C), property(C, "type"), property(C, "name"), property(C, "local"), property_setter(C, "name", _), property_setter(C, "local", _), collection_adder(C, "entriess", _), collection_adder(C, "ingredientss", _), collection_adder(C, "commentss", _), collection_remover(C, "entriess", _), collection_remover(C, "ingredientss", _), collection_remover(C, "commentss", _), collection_setter(C, "entriess", _), collection_setter(C, "ingredientss", _), collection_setter(C, "commentss", _). =====result -[{"C":"nzkpcwbu","Class":"Recipe"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Class":"Recipe"}}] =====query subject_class("Recipe", C), instance(C, "literal://string:Active%20record%20implementation%20test%20local%20link"). =====result -[{"C":"nzkpcwbu"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"}}}] =====query subject_class("Recipe", C), property(C, Property). =====result -[{"C":"nzkpcwbu","Property":"type"},{"C":"nzkpcwbu","Property":"name"},{"C":"nzkpcwbu","Property":"local"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Property":"type"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Property":"name"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Property":"local"}}] =====query subject_class("Recipe", C), property_resolve(C, "type"). =====result @@ -9214,7 +9166,7 @@ false =====query subject_class("Recipe", C), property_setter(C, Property, Setter). =====result -[{"C":"nzkpcwbu","Property":"name","Setter":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"recipe://name\", target: \"value\"}]"},{"C":"nzkpcwbu","Property":"local","Setter":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"recipe://local\", target: \"value\", local: true}]"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Property":"name","Setter":{"atom":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"recipe://name\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Property":"local","Setter":{"atom":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"recipe://local\", target: \"value\", local: true}]"}}}] =====query subject_class("Recipe", C), property_resolve_language(C, "name", Language). =====result @@ -9226,19 +9178,19 @@ false =====query subject_class("Recipe", C), collection(C, Collection). =====result -[{"C":"nzkpcwbu","Collection":"entries"},{"C":"nzkpcwbu","Collection":"ingredients"},{"C":"nzkpcwbu","Collection":"comments"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"entries"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"ingredients"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"comments"}}] =====query subject_class("Recipe", C), collection_adder(C, Collection, Adder). =====result -[{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"recipe://entries\", target: \"value\"}]","C":"nzkpcwbu","Collection":"entriess"},{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"recipe://entries\", target: \"value\"}]","C":"nzkpcwbu","Collection":"ingredientss"},{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"recipe://comment\", target: \"value\"}]","C":"nzkpcwbu","Collection":"commentss"}] +[{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"recipe://entries\", target: \"value\"}]"},"C":{"atom":"nzkpcwbu"},"Collection":"entriess"}},{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"recipe://entries\", target: \"value\"}]"},"C":{"atom":"nzkpcwbu"},"Collection":"ingredientss"}},{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"recipe://comment\", target: \"value\"}]"},"C":{"atom":"nzkpcwbu"},"Collection":"commentss"}}] =====query subject_class("Recipe", C), collection_remover(C, Collection, Remover). =====result -[{"C":"nzkpcwbu","Collection":"entriess","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"recipe://entries\", target: \"value\"}]"},{"C":"nzkpcwbu","Collection":"ingredientss","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"recipe://entries\", target: \"value\"}]"},{"C":"nzkpcwbu","Collection":"commentss","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"recipe://comment\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"entriess","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"recipe://entries\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"ingredientss","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"recipe://entries\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"commentss","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"recipe://comment\", target: \"value\"}]"}}}] =====query subject_class("Recipe", C), collection_setter(C, Collection, Setter). =====result -[{"C":"nzkpcwbu","Collection":"entriess","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"recipe://entries\", target: \"value\"}]"},{"C":"nzkpcwbu","Collection":"ingredientss","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"recipe://entries\", target: \"value\"}]"},{"C":"nzkpcwbu","Collection":"commentss","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"recipe://comment\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"entriess","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"recipe://entries\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"ingredientss","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"recipe://entries\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"commentss","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"recipe://comment\", target: \"value\"}]"}}}] =====consult :- discontiguous(triple/3). :- discontiguous(link/5). @@ -9534,15 +9486,14 @@ collection_getter(nzkpcwbu, Base, "comments", List) :- findall(C, triple(Base, " collection_adder(nzkpcwbu, "commentss", '[{action: "addLink", source: "this", predicate: "recipe://comment", target: "value"}]'). collection_remover(nzkpcwbu, "commentss", '[{action: "removeLink", source: "this", predicate: "recipe://comment", target: "value"}]'). collection_setter(nzkpcwbu, "commentss", '[{action: "collectionSetter", source: "this", predicate: "recipe://comment", target: "value"}]'). - =====query subject_class(Class, C), property(C, "type"), property(C, "name"), property(C, "local"), property_setter(C, "name", _), property_setter(C, "local", _), collection_adder(C, "entriess", _), collection_adder(C, "ingredientss", _), collection_adder(C, "commentss", _), collection_remover(C, "entriess", _), collection_remover(C, "ingredientss", _), collection_remover(C, "commentss", _), collection_setter(C, "entriess", _), collection_setter(C, "ingredientss", _), collection_setter(C, "commentss", _). =====result -[{"C":"nzkpcwbu","Class":"Recipe"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Class":"Recipe"}}] =====query subject_class("Recipe", C), property_setter(C, "name", Setter). =====result -[{"C":"nzkpcwbu","Setter":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"recipe://name\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Setter":{"atom":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"recipe://name\", target: \"value\"}]"}}}] =====query subject_class("Recipe", C), property_resolve_language(C, "name", Language). =====result @@ -9844,7 +9795,6 @@ collection_getter(nzkpcwbu, Base, "comments", List) :- findall(C, triple(Base, " collection_adder(nzkpcwbu, "commentss", '[{action: "addLink", source: "this", predicate: "recipe://comment", target: "value"}]'). collection_remover(nzkpcwbu, "commentss", '[{action: "removeLink", source: "this", predicate: "recipe://comment", target: "value"}]'). collection_setter(nzkpcwbu, "commentss", '[{action: "collectionSetter", source: "this", predicate: "recipe://comment", target: "value"}]'). - =====query subject_class("Recipe", C), property_setter(C, "entries", Setter). =====result @@ -9856,7 +9806,7 @@ false =====query subject_class("Recipe", C), property_setter(C, "local", Setter). =====result -[{"C":"nzkpcwbu","Setter":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"recipe://local\", target: \"value\", local: true}]"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Setter":{"atom":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"recipe://local\", target: \"value\", local: true}]"}}}] =====query subject_class("Recipe", C), property_resolve_language(C, "local", Language). =====result @@ -10160,15 +10110,14 @@ collection_getter(nzkpcwbu, Base, "comments", List) :- findall(C, triple(Base, " collection_adder(nzkpcwbu, "commentss", '[{action: "addLink", source: "this", predicate: "recipe://comment", target: "value"}]'). collection_remover(nzkpcwbu, "commentss", '[{action: "removeLink", source: "this", predicate: "recipe://comment", target: "value"}]'). collection_setter(nzkpcwbu, "commentss", '[{action: "collectionSetter", source: "this", predicate: "recipe://comment", target: "value"}]'). - =====query subject_class("Recipe", C), instance(C, "literal://string:Active%20record%20implementation%20test%20local%20link"). =====result -[{"C":"nzkpcwbu"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"}}}] =====query subject_class("Recipe", C), property(C, Property). =====result -[{"C":"nzkpcwbu","Property":"type"},{"C":"nzkpcwbu","Property":"name"},{"C":"nzkpcwbu","Property":"local"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Property":"type"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Property":"name"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Property":"local"}}] =====query subject_class("Recipe", C), property_resolve(C, "type"). =====result @@ -10176,7 +10125,7 @@ false =====query subject_class("Recipe", C), property_getter(C, "literal://string:Active%20record%20implementation%20test%20local%20link", "type", Value). =====result -[{"C":"nzkpcwbu","Value":"ad4m://recipe"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":"ad4m://recipe"}}] =====query subject_class("Recipe", C), property_resolve(C, "name"). =====result @@ -10184,7 +10133,7 @@ false =====query subject_class("Recipe", C), property_getter(C, "literal://string:Active%20record%20implementation%20test%20local%20link", "name", Value). =====result -[{"C":"nzkpcwbu","Value":"recipe://locallink"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":"recipe://locallink"}}] =====query subject_class("Recipe", C), property_resolve(C, "local"). =====result @@ -10192,15 +10141,15 @@ false =====query subject_class("Recipe", C), property_getter(C, "literal://string:Active%20record%20implementation%20test%20local%20link", "local", Value). =====result -[{"C":"nzkpcwbu","Value":"recipe://test"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":"recipe://test"}}] =====query subject_class("Recipe", C), collection(C, Collection). =====result -[{"C":"nzkpcwbu","Collection":"entries"},{"C":"nzkpcwbu","Collection":"ingredients"},{"C":"nzkpcwbu","Collection":"comments"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"entries"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"ingredients"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"comments"}}] =====query subject_class("Recipe", C), collection_getter(C, "literal://string:Active%20record%20implementation%20test%20local%20link", "entries", Value). =====result -[{"C":"nzkpcwbu","Value":[""]}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":[]}}] =====query subject_class("Recipe", C), collection_getter(C, "literal://string:Active%20record%20implementation%20test%20local%20link", "ingredients", Value). =====result @@ -10208,19 +10157,19 @@ false =====query subject_class("Recipe", C), collection_getter(C, "literal://string:Active%20record%20implementation%20test%20local%20link", "comments", Value). =====result -[{"C":"nzkpcwbu","Value":[""]}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":[]}}] =====query subject_class(Class, C), property(C, "type"), property(C, "name"), property(C, "local"), property_setter(C, "name", _), property_setter(C, "local", _), collection_adder(C, "entriess", _), collection_adder(C, "ingredientss", _), collection_adder(C, "commentss", _), collection_remover(C, "entriess", _), collection_remover(C, "ingredientss", _), collection_remover(C, "commentss", _), collection_setter(C, "entriess", _), collection_setter(C, "ingredientss", _), collection_setter(C, "commentss", _). =====result -[{"C":"nzkpcwbu","Class":"Recipe"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Class":"Recipe"}}] =====query subject_class("Recipe", C), instance(C, "literal://string:Active%20record%20implementation%20test%20local%20link"). =====result -[{"C":"nzkpcwbu"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"}}}] =====query subject_class("Recipe", C), property(C, Property). =====result -[{"C":"nzkpcwbu","Property":"type"},{"C":"nzkpcwbu","Property":"name"},{"C":"nzkpcwbu","Property":"local"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Property":"type"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Property":"name"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Property":"local"}}] =====query subject_class("Recipe", C), property_resolve(C, "type"). =====result @@ -10228,7 +10177,7 @@ false =====query subject_class("Recipe", C), property_getter(C, "literal://string:Active%20record%20implementation%20test%20local%20link", "type", Value). =====result -[{"C":"nzkpcwbu","Value":"ad4m://recipe"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":"ad4m://recipe"}}] =====query subject_class("Recipe", C), property_resolve(C, "name"). =====result @@ -10236,7 +10185,7 @@ false =====query subject_class("Recipe", C), property_getter(C, "literal://string:Active%20record%20implementation%20test%20local%20link", "name", Value). =====result -[{"C":"nzkpcwbu","Value":"recipe://locallink"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":"recipe://locallink"}}] =====query subject_class("Recipe", C), property_resolve(C, "local"). =====result @@ -10244,15 +10193,15 @@ false =====query subject_class("Recipe", C), property_getter(C, "literal://string:Active%20record%20implementation%20test%20local%20link", "local", Value). =====result -[{"C":"nzkpcwbu","Value":"recipe://test"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":"recipe://test"}}] =====query subject_class("Recipe", C), collection(C, Collection). =====result -[{"C":"nzkpcwbu","Collection":"entries"},{"C":"nzkpcwbu","Collection":"ingredients"},{"C":"nzkpcwbu","Collection":"comments"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"entries"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"ingredients"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"comments"}}] =====query subject_class("Recipe", C), collection_getter(C, "literal://string:Active%20record%20implementation%20test%20local%20link", "entries", Value). =====result -[{"C":"nzkpcwbu","Value":[""]}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":[]}}] =====query subject_class("Recipe", C), collection_getter(C, "literal://string:Active%20record%20implementation%20test%20local%20link", "ingredients", Value). =====result @@ -10260,7 +10209,7 @@ false =====query subject_class("Recipe", C), collection_getter(C, "literal://string:Active%20record%20implementation%20test%20local%20link", "comments", Value). =====result -[{"C":"nzkpcwbu","Value":[""]}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":[]}}] =====query subject_class(Class, C), property(C, "className"), property(C, "generateSDNA"). =====result @@ -10268,27 +10217,27 @@ false =====query findall([Timestamp, Base], (subject_class("Recipe", C), instance(C, Base), link("ad4m://self", Predicate, Base, Timestamp, Author)), AllData), sort(AllData, SortedData), length(SortedData, DataLength). =====result -[{"AllData":[[1706790532420,"literal://string:Active%20record%20implementation%20test"],[1706790533626,"literal://string:Active%20record%20implementation%20collection%20test"],[1706790534369,"literal://string:Active%20record%20implementation%20test%20local%20link"]],"DataLength":3,"SortedData":[[1706790532420,"literal://string:Active%20record%20implementation%20test"],[1706790533626,"literal://string:Active%20record%20implementation%20collection%20test"],[1706790534369,"literal://string:Active%20record%20implementation%20test%20local%20link"]]}] +[{"bindings":{"AllData":[[1706790532420,"literal://string:Active%20record%20implementation%20test"],[1706790533626,"literal://string:Active%20record%20implementation%20collection%20test"],[1706790534369,"literal://string:Active%20record%20implementation%20test%20local%20link"]],"DataLength":3,"SortedData":[[1706790532420,"literal://string:Active%20record%20implementation%20test"],[1706790533626,"literal://string:Active%20record%20implementation%20collection%20test"],[1706790534369,"literal://string:Active%20record%20implementation%20test%20local%20link"]]}}] =====query findall([Timestamp, Base], (subject_class("Recipe", C), instance(C, Base), link("ad4m://self", Predicate, Base, Timestamp, Author)), AllData), sort(AllData, SortedData), reverse(SortedData, ReverseSortedData), paginate(ReverseSortedData, 1, 2, PageData). =====result -[{"AllData":[[1706790532420,"literal://string:Active%20record%20implementation%20test"],[1706790533626,"literal://string:Active%20record%20implementation%20collection%20test"],[1706790534369,"literal://string:Active%20record%20implementation%20test%20local%20link"]],"PageData":[[1706790534369,"literal://string:Active%20record%20implementation%20test%20local%20link"],[1706790533626,"literal://string:Active%20record%20implementation%20collection%20test"]],"ReverseSortedData":[[1706790534369,"literal://string:Active%20record%20implementation%20test%20local%20link"],[1706790533626,"literal://string:Active%20record%20implementation%20collection%20test"],[1706790532420,"literal://string:Active%20record%20implementation%20test"]],"SortedData":[[1706790532420,"literal://string:Active%20record%20implementation%20test"],[1706790533626,"literal://string:Active%20record%20implementation%20collection%20test"],[1706790534369,"literal://string:Active%20record%20implementation%20test%20local%20link"]]}] +[{"bindings":{"AllData":[[1706790532420,"literal://string:Active%20record%20implementation%20test"],[1706790533626,"literal://string:Active%20record%20implementation%20collection%20test"],[1706790534369,"literal://string:Active%20record%20implementation%20test%20local%20link"]],"PageData":[[1706790534369,"literal://string:Active%20record%20implementation%20test%20local%20link"],[1706790533626,"literal://string:Active%20record%20implementation%20collection%20test"]],"ReverseSortedData":[[1706790534369,"literal://string:Active%20record%20implementation%20test%20local%20link"],[1706790533626,"literal://string:Active%20record%20implementation%20collection%20test"],[1706790532420,"literal://string:Active%20record%20implementation%20test"]],"SortedData":[[1706790532420,"literal://string:Active%20record%20implementation%20test"],[1706790533626,"literal://string:Active%20record%20implementation%20collection%20test"],[1706790534369,"literal://string:Active%20record%20implementation%20test%20local%20link"]]}}] =====query subject_class(Class, C), property(C, "type"), property(C, "name"), property(C, "local"), property_setter(C, "name", _), property_setter(C, "local", _), collection_adder(C, "entriess", _), collection_adder(C, "ingredientss", _), collection_adder(C, "commentss", _), collection_remover(C, "entriess", _), collection_remover(C, "ingredientss", _), collection_remover(C, "commentss", _), collection_setter(C, "entriess", _), collection_setter(C, "ingredientss", _), collection_setter(C, "commentss", _). =====result -[{"C":"nzkpcwbu","Class":"Recipe"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Class":"Recipe"}}] =====query subject_class("Recipe", C), instance(C, "literal://string:Active%20record%20implementation%20test%20local%20link"). =====query subject_class("Recipe", C), instance(C, "literal://string:Active%20record%20implementation%20collection%20test"). =====result -[{"C":"nzkpcwbu"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"}}}] =====result -[{"C":"nzkpcwbu"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"}}}] =====query subject_class("Recipe", C), property(C, Property). =====result -[{"C":"nzkpcwbu","Property":"type"},{"C":"nzkpcwbu","Property":"name"},{"C":"nzkpcwbu","Property":"local"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Property":"type"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Property":"name"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Property":"local"}}] =====query subject_class("Recipe", C), property_resolve(C, "type"). =====result @@ -10298,9 +10247,9 @@ subject_class("Recipe", C), property_getter(C, "literal://string:Active%20record =====query subject_class("Recipe", C), property_getter(C, "literal://string:Active%20record%20implementation%20test%20local%20link", "type", Value). =====result -[{"C":"nzkpcwbu","Value":"ad4m://recipe"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":"ad4m://recipe"}}] =====result -[{"C":"nzkpcwbu","Value":"ad4m://recipe"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":"ad4m://recipe"}}] =====query subject_class("Recipe", C), property_resolve(C, "name"). =====result @@ -10308,11 +10257,11 @@ false =====query subject_class("Recipe", C), property_getter(C, "literal://string:Active%20record%20implementation%20test%20local%20link", "name", Value). =====result -[{"C":"nzkpcwbu","Value":"recipe://locallink"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":"recipe://locallink"}}] =====query subject_class("Recipe", C), property_getter(C, "literal://string:Active%20record%20implementation%20collection%20test", "name", Value). =====result -[{"C":"nzkpcwbu","Value":"recipe://collection_test"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":"recipe://collection_test"}}] =====query subject_class("Recipe", C), property_resolve(C, "local"). =====result @@ -10320,7 +10269,7 @@ false =====query subject_class("Recipe", C), property_getter(C, "literal://string:Active%20record%20implementation%20test%20local%20link", "local", Value). =====result -[{"C":"nzkpcwbu","Value":"recipe://test"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":"recipe://test"}}] =====query subject_class("Recipe", C), property_getter(C, "literal://string:Active%20record%20implementation%20collection%20test", "local", Value). =====result @@ -10328,15 +10277,15 @@ false =====query subject_class("Recipe", C), collection(C, Collection). =====result -[{"C":"nzkpcwbu","Collection":"entries"},{"C":"nzkpcwbu","Collection":"ingredients"},{"C":"nzkpcwbu","Collection":"comments"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"entries"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"ingredients"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"comments"}}] =====query subject_class("Recipe", C), collection_getter(C, "literal://string:Active%20record%20implementation%20test%20local%20link", "entries", Value). =====query subject_class("Recipe", C), collection_getter(C, "literal://string:Active%20record%20implementation%20collection%20test", "entries", Value). =====result -[{"C":"nzkpcwbu","Value":[""]}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":[]}}] =====result -[{"C":"nzkpcwbu","Value":[""]}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":[]}}] =====query subject_class("Recipe", C), collection_getter(C, "literal://string:Active%20record%20implementation%20collection%20test", "ingredients", Value). =====query @@ -10348,11 +10297,11 @@ false =====query subject_class("Recipe", C), collection_getter(C, "literal://string:Active%20record%20implementation%20collection%20test", "comments", Value). =====result -[{"C":"nzkpcwbu","Value":["recipe://test","recipe://test1"]}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":["recipe://test","recipe://test1"]}}] =====query subject_class("Recipe", C), collection_getter(C, "literal://string:Active%20record%20implementation%20test%20local%20link", "comments", Value). =====result -[{"C":"nzkpcwbu","Value":[""]}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":[]}}] =====query subject_class(Class, C), property(C, "className"), property(C, "generateSDNA"). =====result @@ -10360,23 +10309,23 @@ false =====query findall([Timestamp, Base], (subject_class("Recipe", C), instance(C, Base), link("ad4m://self", Predicate, Base, Timestamp, Author)), AllData), sort(AllData, SortedData), length(SortedData, DataLength). =====result -[{"AllData":[[1706790532420,"literal://string:Active%20record%20implementation%20test"],[1706790533626,"literal://string:Active%20record%20implementation%20collection%20test"],[1706790534369,"literal://string:Active%20record%20implementation%20test%20local%20link"]],"DataLength":3,"SortedData":[[1706790532420,"literal://string:Active%20record%20implementation%20test"],[1706790533626,"literal://string:Active%20record%20implementation%20collection%20test"],[1706790534369,"literal://string:Active%20record%20implementation%20test%20local%20link"]]}] +[{"bindings":{"AllData":[[1706790532420,"literal://string:Active%20record%20implementation%20test"],[1706790533626,"literal://string:Active%20record%20implementation%20collection%20test"],[1706790534369,"literal://string:Active%20record%20implementation%20test%20local%20link"]],"DataLength":3,"SortedData":[[1706790532420,"literal://string:Active%20record%20implementation%20test"],[1706790533626,"literal://string:Active%20record%20implementation%20collection%20test"],[1706790534369,"literal://string:Active%20record%20implementation%20test%20local%20link"]]}}] =====query findall([Timestamp, Base], (subject_class("Recipe", C), instance(C, Base), link("ad4m://self", Predicate, Base, Timestamp, Author)), AllData), sort(AllData, SortedData), reverse(SortedData, ReverseSortedData), paginate(ReverseSortedData, 2, 1, PageData). =====result -[{"AllData":[[1706790532420,"literal://string:Active%20record%20implementation%20test"],[1706790533626,"literal://string:Active%20record%20implementation%20collection%20test"],[1706790534369,"literal://string:Active%20record%20implementation%20test%20local%20link"]],"PageData":[[1706790533626,"literal://string:Active%20record%20implementation%20collection%20test"]],"ReverseSortedData":[[1706790534369,"literal://string:Active%20record%20implementation%20test%20local%20link"],[1706790533626,"literal://string:Active%20record%20implementation%20collection%20test"],[1706790532420,"literal://string:Active%20record%20implementation%20test"]],"SortedData":[[1706790532420,"literal://string:Active%20record%20implementation%20test"],[1706790533626,"literal://string:Active%20record%20implementation%20collection%20test"],[1706790534369,"literal://string:Active%20record%20implementation%20test%20local%20link"]]}] +[{"bindings":{"AllData":[[1706790532420,"literal://string:Active%20record%20implementation%20test"],[1706790533626,"literal://string:Active%20record%20implementation%20collection%20test"],[1706790534369,"literal://string:Active%20record%20implementation%20test%20local%20link"]],"PageData":[[1706790533626,"literal://string:Active%20record%20implementation%20collection%20test"]],"ReverseSortedData":[[1706790534369,"literal://string:Active%20record%20implementation%20test%20local%20link"],[1706790533626,"literal://string:Active%20record%20implementation%20collection%20test"],[1706790532420,"literal://string:Active%20record%20implementation%20test"]],"SortedData":[[1706790532420,"literal://string:Active%20record%20implementation%20test"],[1706790533626,"literal://string:Active%20record%20implementation%20collection%20test"],[1706790534369,"literal://string:Active%20record%20implementation%20test%20local%20link"]]}}] =====query subject_class(Class, C), property(C, "type"), property(C, "name"), property(C, "local"), property_setter(C, "name", _), property_setter(C, "local", _), collection_adder(C, "entriess", _), collection_adder(C, "ingredientss", _), collection_adder(C, "commentss", _), collection_remover(C, "entriess", _), collection_remover(C, "ingredientss", _), collection_remover(C, "commentss", _), collection_setter(C, "entriess", _), collection_setter(C, "ingredientss", _), collection_setter(C, "commentss", _). =====result -[{"C":"nzkpcwbu","Class":"Recipe"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Class":"Recipe"}}] =====query subject_class("Recipe", C), instance(C, "literal://string:Active%20record%20implementation%20collection%20test"). =====result -[{"C":"nzkpcwbu"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"}}}] =====query subject_class("Recipe", C), property(C, Property). =====result -[{"C":"nzkpcwbu","Property":"type"},{"C":"nzkpcwbu","Property":"name"},{"C":"nzkpcwbu","Property":"local"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Property":"type"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Property":"name"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Property":"local"}}] =====query subject_class("Recipe", C), property_resolve(C, "type"). =====result @@ -10384,7 +10333,7 @@ false =====query subject_class("Recipe", C), property_getter(C, "literal://string:Active%20record%20implementation%20collection%20test", "type", Value). =====result -[{"C":"nzkpcwbu","Value":"ad4m://recipe"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":"ad4m://recipe"}}] =====query subject_class("Recipe", C), property_resolve(C, "name"). =====result @@ -10392,7 +10341,7 @@ false =====query subject_class("Recipe", C), property_getter(C, "literal://string:Active%20record%20implementation%20collection%20test", "name", Value). =====result -[{"C":"nzkpcwbu","Value":"recipe://collection_test"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":"recipe://collection_test"}}] =====query subject_class("Recipe", C), property_resolve(C, "local"). =====result @@ -10404,11 +10353,11 @@ false =====query subject_class("Recipe", C), collection(C, Collection). =====result -[{"C":"nzkpcwbu","Collection":"entries"},{"C":"nzkpcwbu","Collection":"ingredients"},{"C":"nzkpcwbu","Collection":"comments"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"entries"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"ingredients"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"comments"}}] =====query subject_class("Recipe", C), collection_getter(C, "literal://string:Active%20record%20implementation%20collection%20test", "entries", Value). =====result -[{"C":"nzkpcwbu","Value":[""]}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":[]}}] =====query subject_class("Recipe", C), collection_getter(C, "literal://string:Active%20record%20implementation%20collection%20test", "ingredients", Value). =====result @@ -10416,7 +10365,7 @@ false =====query subject_class("Recipe", C), collection_getter(C, "literal://string:Active%20record%20implementation%20collection%20test", "comments", Value). =====result -[{"C":"nzkpcwbu","Value":["recipe://test","recipe://test1"]}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":["recipe://test","recipe://test1"]}}] =====query subject_class(Class, C), property(C, "className"), property(C, "generateSDNA"). =====result @@ -10424,19 +10373,19 @@ false =====query subject_class("Recipe", C), instance(C, X). =====result -[{"C":"nzkpcwbu","X":"literal://string:Active%20record%20implementation%20test"},{"C":"nzkpcwbu","X":"literal://string:Active%20record%20implementation%20collection%20test"},{"C":"nzkpcwbu","X":"literal://string:Active%20record%20implementation%20test%20local%20link"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"X":"literal://string:Active%20record%20implementation%20test"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"X":"literal://string:Active%20record%20implementation%20collection%20test"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"X":"literal://string:Active%20record%20implementation%20test%20local%20link"}}] =====query subject_class(Class, C), property(C, "type"), property(C, "name"), property(C, "local"), property_setter(C, "name", _), property_setter(C, "local", _), collection_adder(C, "entriess", _), collection_adder(C, "ingredientss", _), collection_adder(C, "commentss", _), collection_remover(C, "entriess", _), collection_remover(C, "ingredientss", _), collection_remover(C, "commentss", _), collection_setter(C, "entriess", _), collection_setter(C, "ingredientss", _), collection_setter(C, "commentss", _). =====result -[{"C":"nzkpcwbu","Class":"Recipe"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Class":"Recipe"}}] =====query subject_class("Recipe", C), instance(C, "literal://string:Active%20record%20implementation%20test"). =====result -[{"C":"nzkpcwbu"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"}}}] =====query subject_class("Recipe", C), property(C, Property). =====result -[{"C":"nzkpcwbu","Property":"type"},{"C":"nzkpcwbu","Property":"name"},{"C":"nzkpcwbu","Property":"local"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Property":"type"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Property":"name"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Property":"local"}}] =====query subject_class("Recipe", C), property_resolve(C, "type"). =====result @@ -10444,7 +10393,7 @@ false =====query subject_class("Recipe", C), property_getter(C, "literal://string:Active%20record%20implementation%20test", "type", Value). =====result -[{"C":"nzkpcwbu","Value":"ad4m://recipe"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":"ad4m://recipe"}}] =====query subject_class("Recipe", C), property_resolve(C, "name"). =====result @@ -10452,7 +10401,7 @@ false =====query subject_class("Recipe", C), property_getter(C, "literal://string:Active%20record%20implementation%20test", "name", Value). =====result -[{"C":"nzkpcwbu","Value":"recipe://test1"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":"recipe://test1"}}] =====query subject_class("Recipe", C), property_resolve(C, "local"). =====result @@ -10464,11 +10413,11 @@ false =====query subject_class("Recipe", C), collection(C, Collection). =====result -[{"C":"nzkpcwbu","Collection":"entries"},{"C":"nzkpcwbu","Collection":"ingredients"},{"C":"nzkpcwbu","Collection":"comments"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"entries"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"ingredients"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"comments"}}] =====query subject_class("Recipe", C), collection_getter(C, "literal://string:Active%20record%20implementation%20test", "entries", Value). =====result -[{"C":"nzkpcwbu","Value":[""]}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":[]}}] =====query subject_class("Recipe", C), collection_getter(C, "literal://string:Active%20record%20implementation%20test", "ingredients", Value). =====result @@ -10476,19 +10425,19 @@ false =====query subject_class("Recipe", C), collection_getter(C, "literal://string:Active%20record%20implementation%20test", "comments", Value). =====result -[{"C":"nzkpcwbu","Value":[""]}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":[]}}] =====query subject_class(Class, C), property(C, "type"), property(C, "name"), property(C, "local"), property_setter(C, "name", _), property_setter(C, "local", _), collection_adder(C, "entriess", _), collection_adder(C, "ingredientss", _), collection_adder(C, "commentss", _), collection_remover(C, "entriess", _), collection_remover(C, "ingredientss", _), collection_remover(C, "commentss", _), collection_setter(C, "entriess", _), collection_setter(C, "ingredientss", _), collection_setter(C, "commentss", _). =====result -[{"C":"nzkpcwbu","Class":"Recipe"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Class":"Recipe"}}] =====query subject_class("Recipe", C), instance(C, "literal://string:Active%20record%20implementation%20collection%20test"). =====result -[{"C":"nzkpcwbu"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"}}}] =====query subject_class("Recipe", C), property(C, Property). =====result -[{"C":"nzkpcwbu","Property":"type"},{"C":"nzkpcwbu","Property":"name"},{"C":"nzkpcwbu","Property":"local"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Property":"type"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Property":"name"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Property":"local"}}] =====query subject_class("Recipe", C), property_resolve(C, "type"). =====result @@ -10496,7 +10445,7 @@ false =====query subject_class("Recipe", C), property_getter(C, "literal://string:Active%20record%20implementation%20collection%20test", "type", Value). =====result -[{"C":"nzkpcwbu","Value":"ad4m://recipe"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":"ad4m://recipe"}}] =====query subject_class("Recipe", C), property_resolve(C, "name"). =====result @@ -10504,7 +10453,7 @@ false =====query subject_class("Recipe", C), property_getter(C, "literal://string:Active%20record%20implementation%20collection%20test", "name", Value). =====result -[{"C":"nzkpcwbu","Value":"recipe://collection_test"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":"recipe://collection_test"}}] =====query subject_class("Recipe", C), property_resolve(C, "local"). =====result @@ -10516,11 +10465,11 @@ false =====query subject_class("Recipe", C), collection(C, Collection). =====result -[{"C":"nzkpcwbu","Collection":"entries"},{"C":"nzkpcwbu","Collection":"ingredients"},{"C":"nzkpcwbu","Collection":"comments"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"entries"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"ingredients"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"comments"}}] =====query subject_class("Recipe", C), collection_getter(C, "literal://string:Active%20record%20implementation%20collection%20test", "entries", Value). =====result -[{"C":"nzkpcwbu","Value":[""]}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":[]}}] =====query subject_class("Recipe", C), collection_getter(C, "literal://string:Active%20record%20implementation%20collection%20test", "ingredients", Value). =====result @@ -10528,19 +10477,19 @@ false =====query subject_class("Recipe", C), collection_getter(C, "literal://string:Active%20record%20implementation%20collection%20test", "comments", Value). =====result -[{"C":"nzkpcwbu","Value":["recipe://test","recipe://test1"]}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":["recipe://test","recipe://test1"]}}] =====query subject_class(Class, C), property(C, "type"), property(C, "name"), property(C, "local"), property_setter(C, "name", _), property_setter(C, "local", _), collection_adder(C, "entriess", _), collection_adder(C, "ingredientss", _), collection_adder(C, "commentss", _), collection_remover(C, "entriess", _), collection_remover(C, "ingredientss", _), collection_remover(C, "commentss", _), collection_setter(C, "entriess", _), collection_setter(C, "ingredientss", _), collection_setter(C, "commentss", _). =====result -[{"C":"nzkpcwbu","Class":"Recipe"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Class":"Recipe"}}] =====query subject_class("Recipe", C), instance(C, "literal://string:Active%20record%20implementation%20test%20local%20link"). =====result -[{"C":"nzkpcwbu"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"}}}] =====query subject_class("Recipe", C), property(C, Property). =====result -[{"C":"nzkpcwbu","Property":"type"},{"C":"nzkpcwbu","Property":"name"},{"C":"nzkpcwbu","Property":"local"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Property":"type"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Property":"name"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Property":"local"}}] =====query subject_class("Recipe", C), property_resolve(C, "type"). =====result @@ -10548,7 +10497,7 @@ false =====query subject_class("Recipe", C), property_getter(C, "literal://string:Active%20record%20implementation%20test%20local%20link", "type", Value). =====result -[{"C":"nzkpcwbu","Value":"ad4m://recipe"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":"ad4m://recipe"}}] =====query subject_class("Recipe", C), property_resolve(C, "name"). =====result @@ -10556,7 +10505,7 @@ false =====query subject_class("Recipe", C), property_getter(C, "literal://string:Active%20record%20implementation%20test%20local%20link", "name", Value). =====result -[{"C":"nzkpcwbu","Value":"recipe://locallink"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":"recipe://locallink"}}] =====query subject_class("Recipe", C), property_resolve(C, "local"). =====result @@ -10564,15 +10513,15 @@ false =====query subject_class("Recipe", C), property_getter(C, "literal://string:Active%20record%20implementation%20test%20local%20link", "local", Value). =====result -[{"C":"nzkpcwbu","Value":"recipe://test"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":"recipe://test"}}] =====query subject_class("Recipe", C), collection(C, Collection). =====result -[{"C":"nzkpcwbu","Collection":"entries"},{"C":"nzkpcwbu","Collection":"ingredients"},{"C":"nzkpcwbu","Collection":"comments"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"entries"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"ingredients"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"comments"}}] =====query subject_class("Recipe", C), collection_getter(C, "literal://string:Active%20record%20implementation%20test%20local%20link", "entries", Value). =====result -[{"C":"nzkpcwbu","Value":[""]}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":[]}}] =====query subject_class("Recipe", C), collection_getter(C, "literal://string:Active%20record%20implementation%20test%20local%20link", "ingredients", Value). =====result @@ -10580,15 +10529,15 @@ false =====query subject_class("Recipe", C), collection_getter(C, "literal://string:Active%20record%20implementation%20test%20local%20link", "comments", Value). =====result -[{"C":"nzkpcwbu","Value":[""]}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":[]}}] =====query subject_class(Class, C), property(C, "type"), property(C, "name"), property(C, "local"), property_setter(C, "name", _), property_setter(C, "local", _), collection_adder(C, "entriess", _), collection_adder(C, "ingredientss", _), collection_adder(C, "commentss", _), collection_remover(C, "entriess", _), collection_remover(C, "ingredientss", _), collection_remover(C, "commentss", _), collection_setter(C, "entriess", _), collection_setter(C, "ingredientss", _), collection_setter(C, "commentss", _). =====result -[{"C":"nzkpcwbu","Class":"Recipe"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Class":"Recipe"}}] =====query subject_class("Recipe", C), destructor(C, Actions). =====result -[{"Actions":"[{action: \"removeLink\", source: \"this\", predicate: \"ad4m://type\", target: \"ad4m://recipe\"}]","C":"nzkpcwbu"}] +[{"bindings":{"Actions":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"ad4m://type\", target: \"ad4m://recipe\"}]"},"C":{"atom":"nzkpcwbu"}}}] =====consult :- discontiguous(triple/3). :- discontiguous(link/5). @@ -10886,7 +10835,6 @@ collection_getter(nzkpcwbu, Base, "comments", List) :- findall(C, triple(Base, " collection_adder(nzkpcwbu, "commentss", '[{action: "addLink", source: "this", predicate: "recipe://comment", target: "value"}]'). collection_remover(nzkpcwbu, "commentss", '[{action: "removeLink", source: "this", predicate: "recipe://comment", target: "value"}]'). collection_setter(nzkpcwbu, "commentss", '[{action: "collectionSetter", source: "this", predicate: "recipe://comment", target: "value"}]'). - =====query subject_class(Class, C), property(C, "className"), property(C, "generateSDNA"). =====result @@ -10894,19 +10842,19 @@ false =====query subject_class("Recipe", C), instance(C, X). =====result -[{"C":"nzkpcwbu","X":"literal://string:Active%20record%20implementation%20collection%20test"},{"C":"nzkpcwbu","X":"literal://string:Active%20record%20implementation%20test%20local%20link"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"X":"literal://string:Active%20record%20implementation%20collection%20test"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"X":"literal://string:Active%20record%20implementation%20test%20local%20link"}}] =====query subject_class(Class, C), property(C, "type"), property(C, "name"), property(C, "local"), property_setter(C, "name", _), property_setter(C, "local", _), collection_adder(C, "entriess", _), collection_adder(C, "ingredientss", _), collection_adder(C, "commentss", _), collection_remover(C, "entriess", _), collection_remover(C, "ingredientss", _), collection_remover(C, "commentss", _), collection_setter(C, "entriess", _), collection_setter(C, "ingredientss", _), collection_setter(C, "commentss", _). =====result -[{"C":"nzkpcwbu","Class":"Recipe"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Class":"Recipe"}}] =====query subject_class("Recipe", C), instance(C, "literal://string:Active%20record%20implementation%20collection%20test"). =====result -[{"C":"nzkpcwbu"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"}}}] =====query subject_class("Recipe", C), property(C, Property). =====result -[{"C":"nzkpcwbu","Property":"type"},{"C":"nzkpcwbu","Property":"name"},{"C":"nzkpcwbu","Property":"local"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Property":"type"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Property":"name"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Property":"local"}}] =====query subject_class("Recipe", C), property_resolve(C, "type"). =====result @@ -10914,7 +10862,7 @@ false =====query subject_class("Recipe", C), property_getter(C, "literal://string:Active%20record%20implementation%20collection%20test", "type", Value). =====result -[{"C":"nzkpcwbu","Value":"ad4m://recipe"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":"ad4m://recipe"}}] =====query subject_class("Recipe", C), property_resolve(C, "name"). =====result @@ -10922,7 +10870,7 @@ false =====query subject_class("Recipe", C), property_getter(C, "literal://string:Active%20record%20implementation%20collection%20test", "name", Value). =====result -[{"C":"nzkpcwbu","Value":"recipe://collection_test"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":"recipe://collection_test"}}] =====query subject_class("Recipe", C), property_resolve(C, "local"). =====result @@ -10934,11 +10882,11 @@ false =====query subject_class("Recipe", C), collection(C, Collection). =====result -[{"C":"nzkpcwbu","Collection":"entries"},{"C":"nzkpcwbu","Collection":"ingredients"},{"C":"nzkpcwbu","Collection":"comments"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"entries"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"ingredients"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"comments"}}] =====query subject_class("Recipe", C), collection_getter(C, "literal://string:Active%20record%20implementation%20collection%20test", "entries", Value). =====result -[{"C":"nzkpcwbu","Value":[""]}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":[]}}] =====query subject_class("Recipe", C), collection_getter(C, "literal://string:Active%20record%20implementation%20collection%20test", "ingredients", Value). =====result @@ -10946,19 +10894,19 @@ false =====query subject_class("Recipe", C), collection_getter(C, "literal://string:Active%20record%20implementation%20collection%20test", "comments", Value). =====result -[{"C":"nzkpcwbu","Value":["recipe://test","recipe://test1"]}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":["recipe://test","recipe://test1"]}}] =====query subject_class(Class, C), property(C, "type"), property(C, "name"), property(C, "local"), property_setter(C, "name", _), property_setter(C, "local", _), collection_adder(C, "entriess", _), collection_adder(C, "ingredientss", _), collection_adder(C, "commentss", _), collection_remover(C, "entriess", _), collection_remover(C, "ingredientss", _), collection_remover(C, "commentss", _), collection_setter(C, "entriess", _), collection_setter(C, "ingredientss", _), collection_setter(C, "commentss", _). =====result -[{"C":"nzkpcwbu","Class":"Recipe"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Class":"Recipe"}}] =====query subject_class("Recipe", C), instance(C, "literal://string:Active%20record%20implementation%20test%20local%20link"). =====result -[{"C":"nzkpcwbu"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"}}}] =====query subject_class("Recipe", C), property(C, Property). =====result -[{"C":"nzkpcwbu","Property":"type"},{"C":"nzkpcwbu","Property":"name"},{"C":"nzkpcwbu","Property":"local"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Property":"type"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Property":"name"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Property":"local"}}] =====query subject_class("Recipe", C), property_resolve(C, "type"). =====result @@ -10966,7 +10914,7 @@ false =====query subject_class("Recipe", C), property_getter(C, "literal://string:Active%20record%20implementation%20test%20local%20link", "type", Value). =====result -[{"C":"nzkpcwbu","Value":"ad4m://recipe"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":"ad4m://recipe"}}] =====query subject_class("Recipe", C), property_resolve(C, "name"). =====result @@ -10974,7 +10922,7 @@ false =====query subject_class("Recipe", C), property_getter(C, "literal://string:Active%20record%20implementation%20test%20local%20link", "name", Value). =====result -[{"C":"nzkpcwbu","Value":"recipe://locallink"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":"recipe://locallink"}}] =====query subject_class("Recipe", C), property_resolve(C, "local"). =====result @@ -10982,15 +10930,15 @@ false =====query subject_class("Recipe", C), property_getter(C, "literal://string:Active%20record%20implementation%20test%20local%20link", "local", Value). =====result -[{"C":"nzkpcwbu","Value":"recipe://test"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":"recipe://test"}}] =====query subject_class("Recipe", C), collection(C, Collection). =====result -[{"C":"nzkpcwbu","Collection":"entries"},{"C":"nzkpcwbu","Collection":"ingredients"},{"C":"nzkpcwbu","Collection":"comments"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"entries"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"ingredients"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"comments"}}] =====query subject_class("Recipe", C), collection_getter(C, "literal://string:Active%20record%20implementation%20test%20local%20link", "entries", Value). =====result -[{"C":"nzkpcwbu","Value":[""]}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":[]}}] =====query subject_class("Recipe", C), collection_getter(C, "literal://string:Active%20record%20implementation%20test%20local%20link", "ingredients", Value). =====result @@ -10998,19 +10946,19 @@ false =====query subject_class("Recipe", C), collection_getter(C, "literal://string:Active%20record%20implementation%20test%20local%20link", "comments", Value). =====result -[{"C":"nzkpcwbu","Value":[""]}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":[]}}] =====query subject_class(Class, C), property(C, "type"), property(C, "name"), property(C, "local"), property_setter(C, "name", _), property_setter(C, "local", _), collection_adder(C, "entriess", _), collection_adder(C, "ingredientss", _), collection_adder(C, "commentss", _), collection_remover(C, "entriess", _), collection_remover(C, "ingredientss", _), collection_remover(C, "commentss", _), collection_setter(C, "entriess", _), collection_setter(C, "ingredientss", _), collection_setter(C, "commentss", _). =====result -[{"C":"nzkpcwbu","Class":"Recipe"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Class":"Recipe"}}] =====query subject_class(Class, C), property(C, "type"), property(C, "name"), property(C, "local"), property_setter(C, "name", _), property_setter(C, "local", _), collection_adder(C, "entriess", _), collection_adder(C, "ingredientss", _), collection_adder(C, "commentss", _), collection_remover(C, "entriess", _), collection_remover(C, "ingredientss", _), collection_remover(C, "commentss", _), collection_setter(C, "entriess", _), collection_setter(C, "ingredientss", _), collection_setter(C, "commentss", _). =====result -[{"C":"nzkpcwbu","Class":"Recipe"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Class":"Recipe"}}] =====query subject_class("Recipe", C), constructor(C, Actions). =====result -[{"Actions":"[{action: \"addLink\", source: \"this\", predicate: \"ad4m://type\", target: \"ad4m://recipe\"}]","C":"nzkpcwbu"}] +[{"bindings":{"Actions":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"ad4m://type\", target: \"ad4m://recipe\"}]"},"C":{"atom":"nzkpcwbu"}}}] =====consult :- discontiguous(triple/3). :- discontiguous(link/5). @@ -11313,27 +11261,26 @@ collection_getter(nzkpcwbu, Base, "comments", List) :- findall(C, triple(Base, " collection_adder(nzkpcwbu, "commentss", '[{action: "addLink", source: "this", predicate: "recipe://comment", target: "value"}]'). collection_remover(nzkpcwbu, "commentss", '[{action: "removeLink", source: "this", predicate: "recipe://comment", target: "value"}]'). collection_setter(nzkpcwbu, "commentss", '[{action: "collectionSetter", source: "this", predicate: "recipe://comment", target: "value"}]'). - =====query subject_class(Class, C), property(C, "type"), property(C, "name"), property(C, "local"), property_setter(C, "name", _), property_setter(C, "local", _), collection_adder(C, "entriess", _), collection_adder(C, "ingredientss", _), collection_adder(C, "commentss", _), collection_remover(C, "entriess", _), collection_remover(C, "ingredientss", _), collection_remover(C, "commentss", _), collection_setter(C, "entriess", _), collection_setter(C, "ingredientss", _), collection_setter(C, "commentss", _). =====result -[{"C":"nzkpcwbu","Class":"Recipe"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Class":"Recipe"}}] =====query subject_class("Recipe", C), instance(C, "literal://string:Active%20record%20implementation%20collection%20test%20with%20where"). =====result -[{"C":"nzkpcwbu"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"}}}] =====query subject_class(Class, C), property(C, "type"), property(C, "name"), property(C, "local"), property_setter(C, "name", _), property_setter(C, "local", _), collection_adder(C, "entriess", _), collection_adder(C, "ingredientss", _), collection_adder(C, "commentss", _), collection_remover(C, "entriess", _), collection_remover(C, "ingredientss", _), collection_remover(C, "commentss", _), collection_setter(C, "entriess", _), collection_setter(C, "ingredientss", _), collection_setter(C, "commentss", _). =====result -[{"C":"nzkpcwbu","Class":"Recipe"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Class":"Recipe"}}] =====query subject_class("Recipe", C), instance(C, "literal://string:Active%20record%20implementation%20collection%20test%20with%20where"). =====result -[{"C":"nzkpcwbu"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"}}}] =====query subject_class("Recipe", C), property(C, Property). =====result -[{"C":"nzkpcwbu","Property":"type"},{"C":"nzkpcwbu","Property":"name"},{"C":"nzkpcwbu","Property":"local"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Property":"type"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Property":"name"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Property":"local"}}] =====query subject_class("Recipe", C), property_resolve(C, "type"). =====result @@ -11349,7 +11296,7 @@ false =====query subject_class("Recipe", C), property_setter(C, Property, Setter). =====result -[{"C":"nzkpcwbu","Property":"name","Setter":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"recipe://name\", target: \"value\"}]"},{"C":"nzkpcwbu","Property":"local","Setter":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"recipe://local\", target: \"value\", local: true}]"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Property":"name","Setter":{"atom":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"recipe://name\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Property":"local","Setter":{"atom":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"recipe://local\", target: \"value\", local: true}]"}}}] =====query subject_class("Recipe", C), property_resolve_language(C, "name", Language). =====result @@ -11361,19 +11308,19 @@ false =====query subject_class("Recipe", C), collection(C, Collection). =====result -[{"C":"nzkpcwbu","Collection":"entries"},{"C":"nzkpcwbu","Collection":"ingredients"},{"C":"nzkpcwbu","Collection":"comments"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"entries"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"ingredients"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"comments"}}] =====query subject_class("Recipe", C), collection_adder(C, Collection, Adder). =====result -[{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"recipe://entries\", target: \"value\"}]","C":"nzkpcwbu","Collection":"entriess"},{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"recipe://entries\", target: \"value\"}]","C":"nzkpcwbu","Collection":"ingredientss"},{"Adder":"[{action: \"addLink\", source: \"this\", predicate: \"recipe://comment\", target: \"value\"}]","C":"nzkpcwbu","Collection":"commentss"}] +[{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"recipe://entries\", target: \"value\"}]"},"C":{"atom":"nzkpcwbu"},"Collection":"entriess"}},{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"recipe://entries\", target: \"value\"}]"},"C":{"atom":"nzkpcwbu"},"Collection":"ingredientss"}},{"bindings":{"Adder":{"atom":"[{action: \"addLink\", source: \"this\", predicate: \"recipe://comment\", target: \"value\"}]"},"C":{"atom":"nzkpcwbu"},"Collection":"commentss"}}] =====query subject_class("Recipe", C), collection_remover(C, Collection, Remover). =====result -[{"C":"nzkpcwbu","Collection":"entriess","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"recipe://entries\", target: \"value\"}]"},{"C":"nzkpcwbu","Collection":"ingredientss","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"recipe://entries\", target: \"value\"}]"},{"C":"nzkpcwbu","Collection":"commentss","Remover":"[{action: \"removeLink\", source: \"this\", predicate: \"recipe://comment\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"entriess","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"recipe://entries\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"ingredientss","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"recipe://entries\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"commentss","Remover":{"atom":"[{action: \"removeLink\", source: \"this\", predicate: \"recipe://comment\", target: \"value\"}]"}}}] =====query subject_class("Recipe", C), collection_setter(C, Collection, Setter). =====result -[{"C":"nzkpcwbu","Collection":"entriess","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"recipe://entries\", target: \"value\"}]"},{"C":"nzkpcwbu","Collection":"ingredientss","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"recipe://entries\", target: \"value\"}]"},{"C":"nzkpcwbu","Collection":"commentss","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"recipe://comment\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"entriess","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"recipe://entries\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"ingredientss","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"recipe://entries\", target: \"value\"}]"}}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"commentss","Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"recipe://comment\", target: \"value\"}]"}}}] =====consult :- discontiguous(triple/3). :- discontiguous(link/5). @@ -11678,15 +11625,14 @@ collection_getter(nzkpcwbu, Base, "comments", List) :- findall(C, triple(Base, " collection_adder(nzkpcwbu, "commentss", '[{action: "addLink", source: "this", predicate: "recipe://comment", target: "value"}]'). collection_remover(nzkpcwbu, "commentss", '[{action: "removeLink", source: "this", predicate: "recipe://comment", target: "value"}]'). collection_setter(nzkpcwbu, "commentss", '[{action: "collectionSetter", source: "this", predicate: "recipe://comment", target: "value"}]'). - =====query subject_class(Class, C), property(C, "type"), property(C, "name"), property(C, "local"), property_setter(C, "name", _), property_setter(C, "local", _), collection_adder(C, "entriess", _), collection_adder(C, "ingredientss", _), collection_adder(C, "commentss", _), collection_remover(C, "entriess", _), collection_remover(C, "ingredientss", _), collection_remover(C, "commentss", _), collection_setter(C, "entriess", _), collection_setter(C, "ingredientss", _), collection_setter(C, "commentss", _). =====result -[{"C":"nzkpcwbu","Class":"Recipe"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Class":"Recipe"}}] =====query subject_class("Recipe", C), property_setter(C, "name", Setter). =====result -[{"C":"nzkpcwbu","Setter":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"recipe://name\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Setter":{"atom":"[{action: \"setSingleTarget\", source: \"this\", predicate: \"recipe://name\", target: \"value\"}]"}}}] =====query subject_class("Recipe", C), property_resolve_language(C, "name", Language). =====result @@ -11997,11 +11943,10 @@ collection_getter(nzkpcwbu, Base, "comments", List) :- findall(C, triple(Base, " collection_adder(nzkpcwbu, "commentss", '[{action: "addLink", source: "this", predicate: "recipe://comment", target: "value"}]'). collection_remover(nzkpcwbu, "commentss", '[{action: "removeLink", source: "this", predicate: "recipe://comment", target: "value"}]'). collection_setter(nzkpcwbu, "commentss", '[{action: "collectionSetter", source: "this", predicate: "recipe://comment", target: "value"}]'). - =====query subject_class("Recipe", C), collection_setter(C, "entriess", Setter). =====result -[{"C":"nzkpcwbu","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"recipe://entries\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"recipe://entries\", target: \"value\"}]"}}}] =====consult :- discontiguous(triple/3). :- discontiguous(link/5). @@ -12313,11 +12258,10 @@ collection_getter(nzkpcwbu, Base, "comments", List) :- findall(C, triple(Base, " collection_adder(nzkpcwbu, "commentss", '[{action: "addLink", source: "this", predicate: "recipe://comment", target: "value"}]'). collection_remover(nzkpcwbu, "commentss", '[{action: "removeLink", source: "this", predicate: "recipe://comment", target: "value"}]'). collection_setter(nzkpcwbu, "commentss", '[{action: "collectionSetter", source: "this", predicate: "recipe://comment", target: "value"}]'). - =====query subject_class("Recipe", C), collection_setter(C, "commentss", Setter). =====result -[{"C":"nzkpcwbu","Setter":"[{action: \"collectionSetter\", source: \"this\", predicate: \"recipe://comment\", target: \"value\"}]"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Setter":{"atom":"[{action: \"collectionSetter\", source: \"this\", predicate: \"recipe://comment\", target: \"value\"}]"}}}] =====consult :- discontiguous(triple/3). :- discontiguous(link/5). @@ -12633,15 +12577,14 @@ collection_getter(nzkpcwbu, Base, "comments", List) :- findall(C, triple(Base, " collection_adder(nzkpcwbu, "commentss", '[{action: "addLink", source: "this", predicate: "recipe://comment", target: "value"}]'). collection_remover(nzkpcwbu, "commentss", '[{action: "removeLink", source: "this", predicate: "recipe://comment", target: "value"}]'). collection_setter(nzkpcwbu, "commentss", '[{action: "collectionSetter", source: "this", predicate: "recipe://comment", target: "value"}]'). - =====query subject_class("Recipe", C), instance(C, "literal://string:Active%20record%20implementation%20collection%20test%20with%20where"). =====result -[{"C":"nzkpcwbu"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"}}}] =====query subject_class("Recipe", C), property(C, Property). =====result -[{"C":"nzkpcwbu","Property":"type"},{"C":"nzkpcwbu","Property":"name"},{"C":"nzkpcwbu","Property":"local"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Property":"type"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Property":"name"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Property":"local"}}] =====query subject_class("Recipe", C), property_resolve(C, "type"). =====result @@ -12649,7 +12592,7 @@ false =====query subject_class("Recipe", C), property_getter(C, "literal://string:Active%20record%20implementation%20collection%20test%20with%20where", "type", Value). =====result -[{"C":"nzkpcwbu","Value":"ad4m://recipe"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":"ad4m://recipe"}}] =====query subject_class("Recipe", C), property_resolve(C, "name"). =====result @@ -12657,7 +12600,7 @@ false =====query subject_class("Recipe", C), property_getter(C, "literal://string:Active%20record%20implementation%20collection%20test%20with%20where", "name", Value). =====result -[{"C":"nzkpcwbu","Value":"recipe://collection_test"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":"recipe://collection_test"}}] =====query subject_class("Recipe", C), property_resolve(C, "local"). =====result @@ -12669,11 +12612,11 @@ false =====query subject_class("Recipe", C), collection(C, Collection). =====result -[{"C":"nzkpcwbu","Collection":"entries"},{"C":"nzkpcwbu","Collection":"ingredients"},{"C":"nzkpcwbu","Collection":"comments"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"entries"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"ingredients"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"comments"}}] =====query subject_class("Recipe", C), collection_getter(C, "literal://string:Active%20record%20implementation%20collection%20test%20with%20where", "entries", Value). =====result -[{"C":"nzkpcwbu","Value":["literal://string:test%20recipes"]}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":["literal://string:test%20recipes"]}}] =====query subject_class("Recipe", C), collection_getter(C, "literal://string:Active%20record%20implementation%20collection%20test%20with%20where", "ingredients", Value). =====result @@ -12681,7 +12624,7 @@ false =====query subject_class("Recipe", C), collection_getter(C, "literal://string:Active%20record%20implementation%20collection%20test%20with%20where", "comments", Value). =====result -[{"C":"nzkpcwbu","Value":["recipe://test","recipe://test1"]}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":["recipe://test","recipe://test1"]}}] =====consult :- discontiguous(triple/3). :- discontiguous(link/5). @@ -12999,19 +12942,18 @@ collection_getter(nzkpcwbu, Base, "comments", List) :- findall(C, triple(Base, " collection_adder(nzkpcwbu, "commentss", '[{action: "addLink", source: "this", predicate: "recipe://comment", target: "value"}]'). collection_remover(nzkpcwbu, "commentss", '[{action: "removeLink", source: "this", predicate: "recipe://comment", target: "value"}]'). collection_setter(nzkpcwbu, "commentss", '[{action: "collectionSetter", source: "this", predicate: "recipe://comment", target: "value"}]'). - =====query subject_class(Class, C), property(C, "type"), property(C, "name"), property(C, "local"), property_setter(C, "name", _), property_setter(C, "local", _), collection_adder(C, "entriess", _), collection_adder(C, "ingredientss", _), collection_adder(C, "commentss", _), collection_remover(C, "entriess", _), collection_remover(C, "ingredientss", _), collection_remover(C, "commentss", _), collection_setter(C, "entriess", _), collection_setter(C, "ingredientss", _), collection_setter(C, "commentss", _). =====result -[{"C":"nzkpcwbu","Class":"Recipe"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Class":"Recipe"}}] =====query subject_class("Recipe", C), instance(C, "literal://string:Active%20record%20implementation%20collection%20test%20with%20where"). =====result -[{"C":"nzkpcwbu"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"}}}] =====query subject_class("Recipe", C), property(C, Property). =====result -[{"C":"nzkpcwbu","Property":"type"},{"C":"nzkpcwbu","Property":"name"},{"C":"nzkpcwbu","Property":"local"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Property":"type"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Property":"name"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Property":"local"}}] =====query subject_class("Recipe", C), property_resolve(C, "type"). =====result @@ -13019,7 +12961,7 @@ false =====query subject_class("Recipe", C), property_getter(C, "literal://string:Active%20record%20implementation%20collection%20test%20with%20where", "type", Value). =====result -[{"C":"nzkpcwbu","Value":"ad4m://recipe"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":"ad4m://recipe"}}] =====query subject_class("Recipe", C), property_resolve(C, "name"). =====result @@ -13027,7 +12969,7 @@ false =====query subject_class("Recipe", C), property_getter(C, "literal://string:Active%20record%20implementation%20collection%20test%20with%20where", "name", Value). =====result -[{"C":"nzkpcwbu","Value":"recipe://collection_test"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":"recipe://collection_test"}}] =====query subject_class("Recipe", C), property_resolve(C, "local"). =====result @@ -13039,31 +12981,31 @@ false =====query subject_class("Recipe", C), collection(C, Collection). =====result -[{"C":"nzkpcwbu","Collection":"entries"},{"C":"nzkpcwbu","Collection":"ingredients"},{"C":"nzkpcwbu","Collection":"comments"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"entries"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"ingredients"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"comments"}}] =====query subject_class("Recipe", C), collection_getter(C, "literal://string:Active%20record%20implementation%20collection%20test%20with%20where", "entries", Value). =====result -[{"C":"nzkpcwbu","Value":["literal://string:test%20recipes"]}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":["literal://string:test%20recipes"]}}] =====query subject_class("Recipe", C), collection_getter(C, "literal://string:Active%20record%20implementation%20collection%20test%20with%20where", "ingredients", Value). =====result -[{"C":"nzkpcwbu","Value":["literal://string:test%20recipes"]}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":["literal://string:test%20recipes"]}}] =====query subject_class("Recipe", C), collection_getter(C, "literal://string:Active%20record%20implementation%20collection%20test%20with%20where", "comments", Value). =====result -[{"C":"nzkpcwbu","Value":["recipe://test","recipe://test1"]}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":["recipe://test","recipe://test1"]}}] =====query subject_class(Class, C), property(C, "type"), property(C, "name"), property(C, "local"), property_setter(C, "name", _), property_setter(C, "local", _), collection_adder(C, "entriess", _), collection_adder(C, "ingredientss", _), collection_adder(C, "commentss", _), collection_remover(C, "entriess", _), collection_remover(C, "ingredientss", _), collection_remover(C, "commentss", _), collection_setter(C, "entriess", _), collection_setter(C, "ingredientss", _), collection_setter(C, "commentss", _). =====result -[{"C":"nzkpcwbu","Class":"Recipe"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Class":"Recipe"}}] =====query subject_class("Recipe", C), instance(C, "literal://string:Active%20record%20implementation%20collection%20test%20with%20where"). =====result -[{"C":"nzkpcwbu"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"}}}] =====query subject_class("Recipe", C), property(C, Property). =====result -[{"C":"nzkpcwbu","Property":"type"},{"C":"nzkpcwbu","Property":"name"},{"C":"nzkpcwbu","Property":"local"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Property":"type"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Property":"name"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Property":"local"}}] =====query subject_class("Recipe", C), property_resolve(C, "type"). =====result @@ -13071,7 +13013,7 @@ false =====query subject_class("Recipe", C), property_getter(C, "literal://string:Active%20record%20implementation%20collection%20test%20with%20where", "type", Value). =====result -[{"C":"nzkpcwbu","Value":"ad4m://recipe"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":"ad4m://recipe"}}] =====query subject_class("Recipe", C), property_resolve(C, "name"). =====result @@ -13079,7 +13021,7 @@ false =====query subject_class("Recipe", C), property_getter(C, "literal://string:Active%20record%20implementation%20collection%20test%20with%20where", "name", Value). =====result -[{"C":"nzkpcwbu","Value":"recipe://collection_test"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":"recipe://collection_test"}}] =====query subject_class("Recipe", C), property_resolve(C, "local"). =====result @@ -13091,16 +13033,16 @@ false =====query subject_class("Recipe", C), collection(C, Collection). =====result -[{"C":"nzkpcwbu","Collection":"entries"},{"C":"nzkpcwbu","Collection":"ingredients"},{"C":"nzkpcwbu","Collection":"comments"}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"entries"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"ingredients"}},{"bindings":{"C":{"atom":"nzkpcwbu"},"Collection":"comments"}}] =====query subject_class("Recipe", C), collection_getter(C, "literal://string:Active%20record%20implementation%20collection%20test%20with%20where", "entries", Value). =====result -[{"C":"nzkpcwbu","Value":["literal://string:test%20recipes"]}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":["literal://string:test%20recipes"]}}] =====query subject_class("Recipe", C), collection_getter(C, "literal://string:Active%20record%20implementation%20collection%20test%20with%20where", "ingredients", Value). =====result -[{"C":"nzkpcwbu","Value":["literal://string:test%20recipes"]}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":["literal://string:test%20recipes"]}}] =====query subject_class("Recipe", C), collection_getter(C, "literal://string:Active%20record%20implementation%20collection%20test%20with%20where", "comments", Value). =====result -[{"C":"nzkpcwbu","Value":["recipe://test","recipe://test1"]}] +[{"bindings":{"C":{"atom":"nzkpcwbu"},"Value":["recipe://test","recipe://test1"]}}] diff --git a/tests/scryer_lib/main.rs b/tests/scryer_lib/main.rs new file mode 100644 index 000000000..b1ee36bac --- /dev/null +++ b/tests/scryer_lib/main.rs @@ -0,0 +1,49 @@ +use scryer_prolog::machine::Machine; + +#[test] +#[cfg_attr(miri, ignore = "it takes too long to run")] +fn lib_integration_test() { + let mut machine = Machine::new_lib(); + + // File with test commands, i.e. program code to consult and queries to run + let code = include_str!("./lib_integration_test_commands.txt"); + + // Split the code into blocks + let blocks = code.split("====="); + + let mut i = 0; + let mut last_result: Option<_> = None; + // Iterate over the blocks + for block in blocks { + // Trim the block to remove any leading or trailing whitespace + let block = block.trim(); + + // Skip empty blocks + if block.is_empty() { + continue; + } + + // Check if the block is a query + if let Some(query) = block.strip_prefix("query") { + // Parse and execute the query + let result = machine.run_query(query.to_string()); + assert!(result.is_ok()); + + last_result = Some(result); + } else if let Some(code) = block.strip_prefix("consult") { + // Load the code into the machine + machine.consult_module_string("facts", code.to_string()); + } else if let Some(result) = block.strip_prefix("result") { + i += 1; + if let Some(Ok(ref last_result)) = last_result { + let last_result_str = serde_json::to_string(last_result).unwrap(); + //println!("\n\n=====Result No. {i}=======\n{last_result}\n==============="); + println!("=====Result No. {i}======="); + println!("{last_result_str}"); + println!("==============="); + println!(); + assert_eq!(last_result_str, result.to_string().trim()); + } + } + } +}