Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions terminusdb_client/tests/integration_tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,26 @@ def test_class_frame(docker_url):
assert client.get_class_frame("Philosopher") == {'@type': 'Class', 'name': 'xsd:string'}


def test_woql_substr(docker_url):
client = Client(docker_url, user_agent=test_user_agent)
client.connect()
db_name = "philosophers" + str(random())
client.create_database(db_name)
client.connect(db=db_name)
# Add a philosopher schema
schema = {"@type": "Class",
"@id": "Philosopher",
"name": "xsd:string"
}
# Add schema and Socrates
client.insert_document(schema, graph_type="schema")
client.insert_document({"name": "Socrates"})
result = client.query(
WOQLQuery().triple('v:Philosopher', '@schema:name', 'v:Name')
.substr('v:Name', 3, 'v:Substring', 0, 'v:After'))
assert result['bindings'][0]['Substring']['@value'] == 'Soc'


def test_diff_apply_version(docker_url):
client = Client(docker_url, user_agent=test_user_agent)
client.connect()
Expand Down