Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
CaosDB Crawler
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
CaosDB Crawler
Commits
efdb10e3
Commit
efdb10e3
authored
1 year ago
by
Henrik tom Wörden
Browse files
Options
Downloads
Patches
Plain Diff
ENH: allow wildcard is_referenced_by
parent
9361573b
No related branches found
No related tags found
2 merge requests
!160
STY: styling
,
!146
ENH: allow wildcard is_referenced_by
Pipeline
#46655
canceled
1 year ago
Stage: info
Stage: setup
Stage: cert
Stage: style
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CHANGELOG.md
+2
-0
2 additions, 0 deletions
CHANGELOG.md
src/caoscrawler/identifiable_adapters.py
+12
-7
12 additions, 7 deletions
src/caoscrawler/identifiable_adapters.py
with
14 additions
and
7 deletions
CHANGELOG.md
+
2
−
0
View file @
efdb10e3
...
...
@@ -10,6 +10,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added ###
*
'transform' sections can be added to a CFood to apply functions to values stored in variables.
*
default transform functions: submatch, split and replace.
*
`*`
can now be used as a wildcard in the identifiables parameter file to denote
that any Record may reference the identified one.
### Changed ###
-
If the
`parents`
key is used in a cfood at a lower level for a Record that
...
...
This diff is collapsed.
Click to expand it.
src/caoscrawler/identifiable_adapters.py
+
12
−
7
View file @
efdb10e3
...
...
@@ -219,18 +219,23 @@ identifiabel, identifiable and identified record) for a Record.
# separate class too
if
prop
.
name
.
lower
()
==
"
is_referenced_by
"
:
for
givenrt
in
prop
.
value
:
rt_and_children
=
get_children_of_rt
(
givenrt
)
found
=
False
for
rtname
in
rt_and_children
:
if
(
id
(
record
)
in
referencing_entities
and
rtname
in
referencing_entities
[
id
(
record
)]):
identifiable_backrefs
.
extend
(
referencing_entities
[
id
(
record
)][
rtname
])
if
givenrt
==
"
*
"
:
for
rt
,
rec
in
referencing_entities
[
id
(
record
)].
items
():
identifiable_backrefs
.
extend
(
rec
)
found
=
True
else
:
rt_and_children
=
get_children_of_rt
(
givenrt
)
for
rtname
in
rt_and_children
:
if
(
id
(
record
)
in
referencing_entities
and
(
rtname
in
referencing_entities
[
id
(
record
)])):
identifiable_backrefs
.
extend
(
referencing_entities
[
id
(
record
)][
rtname
])
found
=
True
if
not
found
:
# TODO: is this the appropriate error?
raise
NotImplementedError
(
f
"
The following record is missing an identifying property:
"
f
"
The following record is missing an identifying property:
\n
"
f
"
RECORD
\n
{
record
}
\n
Identifying PROPERTY
\n
{
prop
.
name
}
"
)
continue
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment