profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/AstroChelonian/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.

terminusdb/terminusdb 1507

TerminusDB is an open source knowledge graph and document store. Use it to build versioned data products.

AstroChelonian/bokeh-notebooks 0

Interactive Web Plotting with Bokeh in IPython notebook

AstroChelonian/CNTK 0

Microsoft Cognitive Toolkit (CNTK), an open source deep-learning toolkit

AstroChelonian/course-resources-ml-with-experts-budgets 0

Further student resources for DrivenData's 'Machine Learning with the Experts: School Budgets' DataCamp course.

AstroChelonian/NAB 0

The Numenta Anomaly Benchmark

AstroChelonian/resources 0

Repository containing resources (graphics, presentations, texts) for Django Girls organizers

AstroChelonian/sympy 0

A computer algebra system written in pure Python

push eventterminusdb-labs/terminusdb-seshat

Dani Papamaximou

commit sha cd0cec3c2e918aabad74210421a9d2748ba5a3a1

Update README.md

view details

push time in 12 hours

issue commentterminusdb/terminusdb-docs

CURL reference has no user/password

I have added the curl commands according to @spl 's commend below. I am testing the API for response for a token produced by

curl -s -X POST -H 'Accept: application/json' -H 'Content-Type: application/json' -u username:password https://awsomelink.com | jq -r '.id_token'

to see that the the jwt works nicely.

GavinMendelGleason

comment created time in 14 days

push eventterminusdb/terminusdb-docs

AstroChelonian

commit sha d6a4e7574f8aec5eb0644a68ec2076b7eb5a3ac1

added curl example for connection with auth token

view details

AstroChelonian

commit sha ff578b6f2d112619702446e5065aff23d108fb5e

Merge branch 'next' of github.com:terminusdb/terminusdb-docs into next

view details

push time in 14 days

PR opened terminusdb/terminusdb

Reviewers
Bug fixed.

binding the id when replacing the schema document (Id='@context') fixes the error.

When typing:

curl -X PUT -H "Content-Type: application/json" -u "admin:root" "http://localhost:6363/api/document/admin/test563?graph_type=schema&author=me&message=me" --data-binary '{ "@base": "http://example.com/elements/", "@documentation": {"@authors": ["Gavin Mendel-Gleason"], "@description": "This collection gives the periodic table of the elements with all isotopes together with their names, symbols and masses", "@title": "Periodic Table of the Elements"}, "@schema": "http://example.com/elements#", "@type": "@context"}'

The output is:

["@context" ]

In order to use POST with this, the flag for full replacement should be set to 'true':

curl -X POST -H "Content-Type: application/json" -u "admin:root" "http://localhost:6363/api/document/admin/test563?graph_type=schema&author=me&message=me&full_replace=true" --data-binary '{"@base": "http://example.com/elements/", "@documentation": {"@authors": ["Gavin Mendel-Gleason"], "@description": "This collection gives the periodic table of the elements with all isotopes together with their names, symbols and masses", "@title": "Periodic Table of the Elements"}, "@schema": "http://example.com/elements#", "@type": "@context"}'

This returns an empty list:

[]

To check if the methods above work, use:

curl -X GET -H "Content-Type: application/json" -u "admin:root" "http://localhost:6363/api/document/admin/test563?graph_type=schema"

or add minimized=false at the end of the http for nice printing:

curl -X GET -H "Content-Type: application/json" -u "admin:root" "http://localhost:6363/api/document/admin/test563?graph_type=schema&minimized=false"

This returns:

{
  "@base":"http://example.com/elements/",
  "@documentation": {
    "@authors": ["Gavin Mendel-Gleason" ],
    "@description":"This collection gives the periodic table of the elements with all isotopes together with their names, symbols and masses",
    "@title":"Periodic Table of the Elements"
  },
  "@schema":"http://example.com/elements#",
  "@type":"@context"
}

fixed #563

+2 -1

0 comment

1 changed file

pr created time in 15 days

create barnchterminusdb/terminusdb

branch : fix_bug_563

created branch time in 15 days

issue commentterminusdb/terminusdb

No longer possible to set schema documentation

The error described above occurs when the following is typed in:

#!/bin/bash

set -ex

Create the database.

xh 'http://admin:root@localhost:6363/api/db/admin/test563' <<EOF
{"label":"l","comment":"c"}
EOF

Update a schema with a context document (use POST)

curl -X POST -H "Content-Type: application/json" -u "admin:root" "http://localhost:6363/api/document/admin/test563?graph_type=schema&author=me&message=me" --data-binary '{"@base": "http://example.com/elements/", "@documentation": {"@authors": ["Gavin Mendel-Gleason"], "@description": "This collection gives the periodic table of the elements with all isotopes together with their names, symbols and masses", "@title": "Periodic Table of the Elements"}, "@schema": "http://example.com/elements#", "@type": "@context"}'
GavinMendelGleason

comment created time in 15 days

issue commentterminusdb/terminusdb

Ensure Lexicals over optionals work

  1. Do we want to make it impossible for optional fields to have a key?

  2. We need to generate something for lexical keys to have optional fields: a)The lexical key has a value when the optional field exists b) the lexical key does not exist if the optional field does not exist as well

matko

comment created time in 15 days

issue commentterminusdb/terminusdb

Ensure Lexicals over optionals work

To replicate: #!/bin/bash

set -ex

Create the database.

xh 'http://admin:root@localhost:6363/api/db/admin/test570' <<EOF
{"label":"l","comment":"c"}
EOF

#Create a schema with an optional field and a lexical key. curl -X POST -H "Content-Type: application/json" -u "admin:root" "http://localhost:6363/api/document/admin/test570?graph_type=schema&author=me&message=me" --data-binary '{"@id": "Doc", "@type": "Class", "optional_field": {"@type": "Optional", "@class": "xsd:string"}, "@key": { "@type" : "Lexical", "@fields" : ["optional_field"]}}'

Add something in the optional field. curl -X POST -H "Content-Type: application/json" -u "admin:root" "http://localhost:6363/api/document/admin/test570?graph_type=instance&author=me&message=me" --data-binary '{"@type": "Doc", "optional_field": "string"}'

Omit the optional field. curl -X POST -H "Content-Type: application/json" -u "admin:root" "http://localhost:6363/api/document/admin/test570?graph_type=instance&author=me&message=me" --data-binary '{"@type": "Doc"}'

When the optional field is omitted, the following error occurs:


{
  "api:message":"Error: missing_key('terminusdb:///schema#optional_field',json{'@id':_6198,'@type':'terminusdb:///schema#Doc'})\n  [46] throw(error(missing_key('terminusdb:///schema#optional_field',...),_6250))\n  [44] catch('<garbage_collected>','<garbage_collected>','<garbage_collected>') at /usr/lib/swi-prolog/boot/init.pl:533\n  [42] api_document:api_insert_document_(instance,transaction_object{commit_info:commit_info{},descriptor:branch_descriptor{branch_name:\"main\",repository_descriptor: ...},inference_objects:[],instance_objects:[...],parent:transaction_object{descriptor: ...,inference_objects:[],instance_objects: ...,parent: ...,schema_objects: ...},schema_objects:[...]},<stream>(0x7f1388009760),_6332) at /home/astrochelonian/Documents/terminusdb/src/core/api/api_document.pl:188\n  [41] '$bags':findall_loop(_6448,'<garbage_collected>',_6452,[]) at /usr/lib/swi-prolog/boot/bags.pl:99\n  [40] setup_call_catcher_cleanup('$bags':'$new_findall_bag','$bags':findall_loop(_6506,...,_6510,[]),_6488,'$bags':'$destroy_findall_bag') at /usr/lib/swi-prolog/boot/init.pl:614\n  [36] '<meta-call>'('<garbage_collected>') <foreign>\n  [35] database:with_transaction_(query_context{all_witnesses:false,authorization:'terminusdb://system/data/User/admin',bindings:[],commit_info:commit_info{author:me,message:me},default_collection:branch_descriptor{branch_name:\"main\",repository_descriptor: ...},files:[],filter:type_filter{types: ...},prefixes:_6718{'@base':\"terminusdb:///data/\",'@schema':\"terminusdb:///schema#\",'@type':'Context',api:'http://terminusdb.com/schema/api#',owl:'http://www.w3.org/2002/07/owl#',rdf:'http://www.w3.org/1999/02/22-rdf-syntax-ns#',rdfs:'http://www.w3.org/2000/01/rdf-schema#',sys:'http://terminusdb.com/schema/sys#',vio:'http://terminusdb.com/schema/vio#',woql:'http://terminusdb.com/schema/woql#',xdd:'http://terminusdb.com/schema/xdd#',xsd:'http://www.w3.org/2001/XMLSchema#'},selected:[],system:system_descriptor{},transaction_objects:[...],update_guard:_6642,write_graph:branch_graph{branch_name:\"main\",database_name:\"test570\",organization_name:\"admin\",repository_name:\"local\",type:instance}},api_document:(...;...),_6592) at /home/astrochelonian/Documents/terminusdb/src/core/transaction/database.pl:220\n  [34] setup_call_catcher_cleanup(database:true,database:with_transaction_(...,...,_6834),_6812,database:true) at /usr/lib/swi-prolog/boot/init.pl:614\n  [30] '<meta-call>'('<garbage_collected>') <foreign>\n  [29] catch(routes:(...,...),error(missing_key('terminusdb:///schema#optional_field',...),context(_6936,_6938)),routes:do_or_die(...,...)) at /usr/lib/swi-prolog/boot/init.pl:532\n  [28] catch_with_backtrace('<garbage_collected>','<garbage_collected>','<garbage_collected>') at /usr/lib/swi-prolog/boot/init.pl:582\n\nNote: some frames are missing due to last-call optimization.\nRe-run your program in debug mode (:- debug.) to get more detail.\n\n",
  "api:status":"api:server_error"
}%                   
matko

comment created time in 15 days

issue closedterminusdb/terminusdb

return empty array on document retrieval when there's no elements

when a document has a property which is an array, and that array is empty, the returned document will have that property missing.

It should instead return an empty list.

closed time in 15 days

matko

issue commentterminusdb/terminusdb

return empty array on document retrieval when there's no elements

Accepted this as the default behaviour for now. We might re-visit this later.

matko

comment created time in 15 days

issue commentterminusdb/terminusdb

return empty array on document retrieval when there's no elements

to replicate: #!/bin/bash

Create the database.

xh 'http://admin:root@localhost:6363/api/db/admin/test497' <<EOF {"label":"l","comment":"c"} EOF

Create a type that contains an array.

curl -X POST -H "Content-Type: application/json" -u "admin:root" "http://localhost:6363/api/document/admin/test497?graph_type=schema&author=me&message=me" --data-binary '{"@id": "ArrayTestDoc", "@type": "Class", "array": {"@type": "Array", "@class": "xsd:string"}}'

Create a document in ArrayTestDoc.

curl -X POST -H "Content-Type: application/json" -u "admin:root" "http://localhost:6363/api/document/admin/test497?graph_type=instance&author=me&message=me" --data-binary '{"@id": "ArrayTestDoc/IdForArrayDoc", "@type": "ArrayTestDoc", "array": ["array1", "array2", "array3"]}'

Insert a document with an empty field array.

curl -X POST -H "Content-Type: application/json" -u "admin:root" "http://localhost:6363/api/document/admin/test497?graph_type=instance&author=me&message=me" --data-binary '{"@id": "ArrayTestDoc/IdForArrayDocEmpty", "@type": "ArrayTestDoc", "array": []}' #Read the document with the field array. curl -X GET -H "Content-Type: application/json" -u "admin:root" "http://localhost:6363/api/document/admin/test497?graph_type=instance"

Output:

 {"@id":"ArrayTestDoc/IdForArrayDoc", "@type":"ArrayTestDoc", "array": ["array1", "array2", "array3" ]}
{"@id":"ArrayTestDoc/IdForArrayDocEmpty", "@type":"ArrayTestDoc"}
matko

comment created time in 15 days

delete branch terminusdb/terminusdb

delete branch : api_reference

delete time in 21 days

PR closed terminusdb/terminusdb

Api reference

I have updated the document and checked if it reflects the current API status. I will update the document whenever a change in the API is implemented.

+345 -160

1 comment

2 changed files

AstroChelonian

pr closed time in 21 days

pull request commentterminusdb/terminusdb

Api reference

Closed due to updated document strategy.

AstroChelonian

comment created time in 21 days

PR opened terminusdb/terminusdb

Cryptic rebase error fixed.

fixed #537

+4 -5

0 comment

1 changed file

pr created time in 21 days

create barnchterminusdb/terminusdb

branch : unknown_branch_error_460

created branch time in 21 days

issue openedterminusdb/terminusdb

Cryptic Error When Rebasing Branch

When rebasing a branch, and the "rebase_from" and/or the "author" values are not provided the error report does not reflect accurately the situation.

To reproduce:

Output

HTTP/1.1 500 Internal Server Error
Connection: close
Content-Length: 69
Content-Type: application/json; charset=UTF-8
Date: Tue, 07 Sep 2021 14:32:08 GMT

{
    "code": 500,
    "message": "Arguments are not sufficiently instantiated"
}

created time in 21 days

issue commentterminusdb/terminusdb

Rebase with unknown branch (not main) gives bad error

To replicate the error:

#!/bin/bash

set -ex

# Create the database.
xh 'http://admin:root@localhost:6363/api/db/admin/t' <<EOF
{"label":"l","comment":"c"}
EOF

# Create the schema.
xh 'http://admin:root@localhost:6363/api/document/admin/t?author=a&message=m&graph_type=schema' <<EOF
{"@type": "Class","@id": "String"}
EOF

# Create a branch.
xh 'http://admin:root@localhost:6363/api/branch/admin/t/local/branch/stars' << EOF
{"origin" : "admin/t"}
EOF

# Rebase a known branch.
xh 'http://admin:root@localhost:6363/api/rebase/admin/t/local/branch/main' << EOF
{"rebase_from" : "admin/t/local/branch/stars", "author":"me"}
EOF

# Rebase an unknown branch.
xh 'http://admin:root@localhost:6363/api/rebase/admin/t/local/branch/main' << EOF
{"rebase_from" : "admin/t/local/branch/unknown", "author":"me"}
EOF

This gives:

{
    "api:message": {
        "@type": "xsd:string",
        "@value": "Unexpected failure in request handler"
    },
    "api:status": "api:failure"
}
spl

comment created time in 21 days

pull request commentterminusdb/terminusdb

improved submitted DocId error

The error now is the following:

{
    "@type": "api:InsertDocumentErrorResponse",
    "api:error": {
        "@type": "api:SubmittedDocIdDoesNotHaveExpectedPrefix",
        "api:document": {
            "@id": "something",
            "@type": "String"
        },
        "api:prefix": "terminusdb:///data/String/",
        "api:submitted_id": "terminusdb:///data/something"
    },
    "api:message": "Document id 'terminusdb:///data/something' does not have expected prefix 'terminusdb:///data/String/'",
    "api:status": "api:failure"
}

AstroChelonian

comment created time in 21 days

PR opened terminusdb/terminusdb

improved submitted DocId error

fixes #509 fixes #528

+8 -10

0 comment

3 changed files

pr created time in 21 days

create barnchterminusdb/terminusdb

branch : cryptic_base_error_509

created branch time in 21 days

issue closedterminusdb/terminusdb

error with terminusdb db delete database

After creating a database using ./terminusdb db create, an error occurs.

To reproduce

Step 1: Create a new empty database:

./terminusdb db create test_delete_db --label label --comment comment --prefixes '{"@base":"http://base/","@schema":"http://schema/"}'
Database admin/test_delete_db created

Step 2: try deleting the database above:

 ./terminusdb db delete admin/test_delete_db 

The following error occurs:

[17] terminus_store:delete_named_graph(<store>,'admin%7ctest_delete_db')
  [16] triplestore:safe_delete_named_graph(<store>,'admin|test_delete_db') at /home/astrochelonian/Documents/terminusdb/src/core/triple/triplestore.pl:213
  [14] utils:do_or_die('<garbage_collected>',error(database_files_do_not_exist("admin","test_delete_db"),_10888)) at /home/astrochelonian/Documents/terminusdb/src/core/util/utils.pl:106
  [13] db_delete:delete_db('<garbage_collected>','terminusdb://system/data/admin',"admin","test_delete_db",false) at /home/astrochelonian/Documents/terminusdb/src/core/api/db_delete.pl:48
  [12] catch(cli:delete_db(...,'terminusdb://system/data/admin',"admin","test_delete_db",false),error(existence_error(procedure,...),context(...,_11008)),cli:do_or_die(...,...)) at /usr/lib/swi-prolog/boot/init.pl:532
  [11] catch_with_backtrace('<garbage_collected>','<garbage_collected>','<garbage_collected>') at /usr/lib/swi-prolog/boot/init.pl:582

Step 3: Try force deleting the database (add --force).

 ./terminusdb db delete admin/test_delete_db  --force

The same error occurs:

  [17] terminus_store:delete_named_graph(<store>,'admin%7ctest_delete_db')
  [16] triplestore:safe_delete_named_graph(<store>,'admin|test_delete_db') at /home/astrochelonian/Documents/terminusdb/src/core/triple/triplestore.pl:213
  [14] db_delete:force_delete_db("admin","test_delete_db") at /home/astrochelonian/Documents/terminusdb/src/core/api/db_delete.pl:96
  [12] catch(cli:delete_db(...,'terminusdb://system/data/admin',"admin","test_delete_db",true),error(existence_error(procedure,...),context(...,_1102)),cli:do_or_die(...,...)) at /usr/lib/swi-prolog/boot/init.pl:532
  [11] catch_with_backtrace(cli:delete_db(...,'terminusdb://system/data/admin',"admin","test_delete_db",true),error(existence_error(procedure,...),context(...,_1184)),cli:do_or_die(...,...)) at /usr/lib/swi-prolog/boot/init.pl:582

closed time in 21 days

AstroChelonian

issue commentterminusdb/terminusdb

error with terminusdb db delete database

This error was happening because I didn't update to the newest terminus_store_prolog-0.19.1.

AstroChelonian

comment created time in 21 days

issue commentterminusdb/terminusdb

error with terminusdb db delete database

I can't reproduce with a freshly initialized store. And, just to make sure it wasn't a problem with my system configuration, I did it in the docker container:

$ docker run -it terminusdb/terminusdb-server:dev /bin/bash
root@fa4edb2016b2:/app/terminusdb# ./terminusdb store init --force
Successfully initialised database!!!
root@fa4edb2016b2:/app/terminusdb# ./terminusdb db create test_delete_db --label label --comment comment --prefixes '{"@base":"http://base/","@schema":"http://schema/"}'
Database admin/test_delete_db created
root@fa4edb2016b2:/app/terminusdb#  ./terminusdb db delete admin/test_delete_db 
Database admin/test_delete_db deleted

When i have a brand new store, I can't reproduce it as well. I tried your approach in docker and it works. My next step is to nuke my old store, start a new one, and see what happens.

AstroChelonian

comment created time in 22 days

delete branch terminusdb/terminusdb

delete branch : catch-unexpected_end_of_file

delete time in 22 days

push eventterminusdb/terminusdb

Sean Leather

commit sha 205a2b182bab082a6e36e676575f8a319c58e07a

Catch json(unexpected_end_of_file) and throw Fixes #473

view details

Dani

commit sha c3663cb88d4c32ad5e9ddfaca37273deb363a73e

Merge pull request #522 from terminusdb/catch-unexpected_end_of_file Catch json(unexpected_end_of_file) and throw malformed_json_payload

view details

push time in 22 days

issue closedterminusdb/terminusdb

Request body parse failures are not reported properly

When a request body is parsed, and this fails with for example a json parse error, this is reported back to the user as a 'ViolationWithDatatypeObject'. This is caused by old code that assumes such all parse errors must occur in the context of converting something to an xsd datatype.

We need to return the proper error, mentioning the proper response type corresponding with the request, and using a valid inner error. This currently already happens in the document interface, but not everywhere else.

For example, see this example from #470:

echo '' | xh 'http://localhost:6363/api/db/unknown' # POST
HTTP/1.1 400 Bad Request
connection: keep-alive
content-length: 173
content-type: application/json
date: Thu, 26 Aug 2021 08:51:43 GMT

{
    "api:status": "api:failure",
    "system:witnesses": [
        {
            "@type": "vio:ViolationWithDatatypeObject",
            "vio:literal": "json(unexpected_end_of_file)"
        }
    ]
}

closed time in 22 days

matko
PullRequestEvent