Conversation
…rds-with-context-input
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #513 +/- ##
==========================================
+ Coverage 84.58% 85.02% +0.44%
==========================================
Files 30 30
Lines 4890 4963 +73
==========================================
+ Hits 4136 4220 +84
+ Misses 754 743 -11 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| from tripper.datadoc.errors import InvalidDatadocError | ||
| from tripper.datadoc.utils import getlabel | ||
|
|
||
| assert getlabel({"@id": "ex:A", "prefLabel": "a"}) == "a" |
There was a problem hiding this comment.
Add check for precendence of labels
| context = get_context(default_theme=None) | ||
| update_context(sources, context) | ||
| c = context.get_context_dict() | ||
| assert c["instr"] == {"@id": EX.instr, "@type": HUME.Device} |
There was a problem hiding this comment.
No instances in context
| c = context.get_context_dict() | ||
| assert c["instr"] == {"@id": EX.instr, "@type": HUME.Device} | ||
| assert c["MyDevice"] == {"@id": EX.MyDevice, "@type": OWL.Class} | ||
| assert c["Device"] == {"@id": HUME.Device, "@type": OWL.Class} |
There was a problem hiding this comment.
Should have som check on what happens if there is mismatch between previously added context and updated_context.
| DCTERMS.creator: "some", | ||
| DCTERMS.hasPart: "value", | ||
| DCTERMS.issued: "value", | ||
| # DCTERMS.issued: "value", |
There was a problem hiding this comment.
Why is this commented out?
| # "@type": "owl:Class", | ||
| "subClassOf": HUME.Device, | ||
| "hasPart": HUME.MeasuringInstrument, | ||
| "hasPart": [HUME.MeasuringInstrument, "ex:MyDevice"], |
There was a problem hiding this comment.
Should it have itself as part?
| { | ||
| # An individial relating to two classes and an individual. | ||
| # Should be converted to an existential restriction. | ||
| "@id": "ex:instr3", | ||
| "@type": HUME.Device, | ||
| "hasPart": [HUME.MeasuringInstrument, "MyDevice", "ex:instr"], | ||
| }, |
There was a problem hiding this comment.
For completeness we should have individual relating to one individual and individual related to a list of individuals
| # WRONG! Should be converted to restrictions | ||
| "@id": "ex:instr3", |
| ) | ||
|
|
||
| with warnings.catch_warnings(): | ||
| warnings.simplefilter("ignore", category=TripperWarning) |
There was a problem hiding this comment.
What kind of tripperwarnings. I think it would be useful to write a comment on what kid of warnings we expect and why it is OK to ignore them
| ## | ||
|
|
| ) | ||
| if prefixes: | ||
| context.add_context({k: str(v) for k, v in prefixes.items()}) | ||
|
|
Description
Added
contextargument to get_keywords().Some functionality that should have been in PR #513 has leaked into this PR
Type of change
Checklist for the reviewer
This checklist should be used as a help for the reviewer.