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
68253aa7
Commit
68253aa7
authored
1 year ago
by
Henrik tom Wörden
Browse files
Options
Downloads
Patches
Plain Diff
wip
parent
798f072b
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!178
FIX: #96 Better error output for crawl.py script.
,
!167
Sync Graph
Pipeline
#50080
failed
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
src/caoscrawler/sync_graph.py
+22
-13
22 additions, 13 deletions
src/caoscrawler/sync_graph.py
src/caoscrawler/sync_node.py
+9
-1
9 additions, 1 deletion
src/caoscrawler/sync_node.py
with
31 additions
and
14 deletions
src/caoscrawler/sync_graph.py
+
22
−
13
View file @
68253aa7
...
...
@@ -135,6 +135,8 @@ class SyncGraph():
for
el
in
self
.
nodes
:
entities
.
append
(
el
.
export_entity
())
node_map
[
id
(
el
)]
=
entities
[
-
1
]
for
oel
in
el
.
other
:
node_map
[
id
(
oel
)]
=
entities
[
-
1
]
for
ent
in
entities
:
for
p
in
ent
.
properties
:
if
isinstance
(
p
.
value
,
list
):
...
...
@@ -415,19 +417,7 @@ class SyncGraph():
"""
assert
source
is
not
target
target
.
update
(
source
)
if
id
(
source
)
in
self
.
_missing
and
id
(
target
)
not
in
self
.
_missing
:
self
.
_treat_missing
(
target
)
if
id
(
source
)
in
self
.
_existing
and
id
(
target
)
not
in
self
.
_existing
:
self
.
_treat_existing
(
target
)
if
(
target
.
identifiable
is
None
and
not
self
.
identity_relies_on_unchecked_entity
(
target
)):
try
:
identifiable
=
self
.
identifiableAdapter
.
get_identifiable
(
target
,
self
.
backward_id_referenced_by
[
target
.
uuid
])
self
.
set_identifiable_of_node
(
target
,
identifiable
)
except
Exception
as
es
:
print
(
es
)
pass
target
.
other
.
append
(
source
)
# update reference mappings
for
node
in
self
.
forward_references
.
pop
(
source
.
uuid
):
...
...
@@ -461,8 +451,27 @@ class SyncGraph():
self
.
nodes
.
remove
(
source
)
if
source
in
self
.
unchecked
:
self
.
unchecked
.
remove
(
source
)
else
:
self
.
unchecked
.
remove
(
target
)
assert
id
(
source
)
not
in
self
.
_missing
assert
id
(
source
)
not
in
self
.
_existing
if
target
.
id
is
not
None
:
self
.
_id_look_up
[
target
.
id
]
=
target
if
target
.
path
is
not
None
:
self
.
_path_look_up
[
target
.
path
]
=
target
if
(
target
.
identifiable
is
None
and
not
self
.
identity_relies_on_unchecked_entity
(
target
)):
try
:
identifiable
=
self
.
identifiableAdapter
.
get_identifiable
(
target
,
self
.
backward_id_referenced_by
[
target
.
uuid
])
self
.
set_identifiable_of_node
(
target
,
identifiable
)
except
Exception
as
es
:
print
(
es
)
pass
if
id
(
source
)
in
self
.
_missing
and
id
(
target
)
not
in
self
.
_missing
:
self
.
_treat_missing
(
target
)
if
id
(
source
)
in
self
.
_existing
and
id
(
target
)
not
in
self
.
_existing
:
self
.
_treat_existing
(
target
)
def
_initialize_nodes
(
self
,
entities
):
"""
create initial set of SemanticEntities from provided Entity list
"""
...
...
This diff is collapsed.
Click to expand it.
src/caoscrawler/sync_node.py
+
9
−
1
View file @
68253aa7
...
...
@@ -61,6 +61,7 @@ class SyncNode():
self
.
uuid
=
uuid
()
self
.
identifiable
=
None
self
.
registered_identifiable
=
registered_identifiable
self
.
other
=
[]
def
update
(
self
,
other
:
SyncNode
)
->
None
:
if
other
.
identifiable
is
not
None
and
self
.
identifiable
is
not
None
:
...
...
@@ -92,7 +93,14 @@ class SyncNode():
ent
.
add_parent
(
p
)
for
p
in
self
.
properties
:
if
ent
.
get_property
(
p
)
is
not
None
:
if
ent
.
get_property
(
p
).
value
!=
p
.
value
:
entval
=
ent
.
get_property
(
p
).
value
pval
=
p
.
value
if
isinstance
(
entval
,
SyncNode
)
and
entval
.
id
is
not
None
:
entval
=
entval
.
id
if
isinstance
(
pval
,
SyncNode
)
and
pval
.
id
is
not
None
:
pval
=
pval
.
id
if
entval
!=
pval
:
raise
db
.
apiutils
.
EntityMergeConflictError
(
f
"
Differing values were set for Property
{
p
.
name
}
:
\n
"
f
"
{
ent
.
get_property
(
p
).
value
}
\n
{
p
.
value
}
"
)
else
:
...
...
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