Skip to content

Commit

Permalink
Merge branch 'develop_carsten' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
cknoll committed Nov 6, 2023
2 parents 2046662 + ff2f450 commit 6de392a
Show file tree
Hide file tree
Showing 8 changed files with 400 additions and 182 deletions.
2 changes: 2 additions & 0 deletions docs/source/userdoc/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ In Pyerk there are the following kinds of keys:
- d) prefixed name-labeled key like `"bi__R1234__my_relation"`
- e) index-labeld key like `"R1234['my relation']"`

Note: prefixed and name-labled keys can optionally have a language indicator. Examples: ``"bi__R1__de"`` or `"R1__has_label__fr"`.

Also, the leading character indicates the entity type (called `EType` in the code): `I` → item, `R` → relation.

The usage of these syntax variants depens on the context.
Expand Down
7 changes: 7 additions & 0 deletions src/pyerk/auxiliary.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,10 @@ class PyERKError(Exception):
"""
raised in situations where some ERK-specific conditions are violated
"""
pass


class MultilingualityError(PyERKError):
pass


Expand Down Expand Up @@ -151,6 +154,10 @@ class InvalidGeneralKeyError(PyERKError):
pass


class InconsistentLabelError(PyERKError):
pass


# used for syntactically correct keys which could not be found
class ShortKeyNotFoundError(PyERKError):
pass
Expand Down
9 changes: 7 additions & 2 deletions src/pyerk/builtin_entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -1282,7 +1282,12 @@ def _get_subscope(self, name: str):
assert isinstance(name, str)
scope_rels: list = self.get_inv_relations("R21__is_scope_of", return_subj=True)

res = [rel for rel in scope_rels if rel.R1 == name or rel.R1 == f"scp__{name}"]
res = []
for rel in scope_rels:
assert isinstance(rel.R1, core.Literal)
r1 = rel.R1.value
if r1 == name or r1 == f"scp__{name}":
res.append(rel)

if len(res) == 0:
msg = f"no scope with name {name} could be found"
Expand Down Expand Up @@ -2301,7 +2306,7 @@ def set_multiple_statements(subjects: Union[list, tuple], predicate: Relation, o
"specifies that the subject should be threated according to the mode (int number) when constructing the "
"prototype graph of an I41__semantic_rule; Modes: 0 -> normal; 1 -> ignore node, 2 -> relation statement, "
"3 -> variable literal, 4 -> function-anchor; 5 -> create_asserted_statement_only_if_new; "
"currently '2' is not implemented.",
"currently '2' is not implemented."
),
R8__has_domain_of_argument_1=I1["general item"],
R11__has_range_of_result=int,
Expand Down
Loading

0 comments on commit 6de392a

Please sign in to comment.