Skip to content

Commit 7390324

Browse files
committed
Restore "existence_query_properties" attribute to EmbeddedMetadata subclasses.
Even though EmbeddedMetadata instances can't be queried directly, the query properties of KGObject subclasses sometimes include EmbeddedMetadata. For example: File --> hashes
1 parent 18230d4 commit 7390324

27 files changed

+26
-2
lines changed

builder/fairgraph_module_template.py.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,7 @@ class {{ class_name }}({{base_class}}, OM{{ class_name }}):
4242
{%- if aliases %}
4343
aliases = {{ aliases }}
4444
{%- endif %}
45-
{%- if default_space %}
4645
existence_query_properties = {{ existence_query_properties }}
47-
{%- endif %}
4846

4947
def __init__(self {%- for arg in constructor_arguments -%}, {{arg}}=None{%- endfor -%}, id=None, data=None, space=None, release_status=None):
5048
return {{ base_class }}.__init__(self, {{ standard_init_properties }}data=data {%- for arg in constructor_arguments -%}, {{arg}}={{arg}}{%- endfor -%})

fairgraph/openminds/chemicals/amount_of_chemical.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ class AmountOfChemical(EmbeddedMetadata, OMAmountOfChemical):
1717
type_ = "https://openminds.om-i.org/types/AmountOfChemical"
1818
# forward properties are defined in the parent class (in openMINDS-Python)
1919
reverse_properties = []
20+
existence_query_properties = ("chemical_product", "amount")
2021

2122
def __init__(self, amount=None, chemical_product=None, id=None, data=None, space=None, release_status=None):
2223
return EmbeddedMetadata.__init__(self, data=data, amount=amount, chemical_product=chemical_product)

fairgraph/openminds/core/actors/affiliation.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ class Affiliation(EmbeddedMetadata, OMAffiliation):
2020
type_ = "https://openminds.om-i.org/types/Affiliation"
2121
# forward properties are defined in the parent class (in openMINDS-Python)
2222
reverse_properties = []
23+
existence_query_properties = ("member_of",)
2324

2425
def __init__(
2526
self, end_date=None, member_of=None, start_date=None, id=None, data=None, space=None, release_status=None

fairgraph/openminds/core/actors/contribution.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ class Contribution(EmbeddedMetadata, OMContribution):
1717
type_ = "https://openminds.om-i.org/types/Contribution"
1818
# forward properties are defined in the parent class (in openMINDS-Python)
1919
reverse_properties = []
20+
existence_query_properties = ("contributor", "types")
2021

2122
def __init__(self, contributor=None, types=None, id=None, data=None, space=None, release_status=None):
2223
return EmbeddedMetadata.__init__(self, data=data, contributor=contributor, types=types)

fairgraph/openminds/core/data/copyright.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ class Copyright(EmbeddedMetadata, OMCopyright):
1717
type_ = "https://openminds.om-i.org/types/Copyright"
1818
# forward properties are defined in the parent class (in openMINDS-Python)
1919
reverse_properties = []
20+
existence_query_properties = ("holders", "years")
2021

2122
def __init__(self, holders=None, years=None, id=None, data=None, space=None, release_status=None):
2223
return EmbeddedMetadata.__init__(self, data=data, holders=holders, years=years)

fairgraph/openminds/core/data/file_path_pattern.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ class FilePathPattern(EmbeddedMetadata, OMFilePathPattern):
1717
type_ = "https://openminds.om-i.org/types/FilePathPattern"
1818
# forward properties are defined in the parent class (in openMINDS-Python)
1919
reverse_properties = []
20+
existence_query_properties = ("grouping_types", "regex")
2021

2122
def __init__(self, grouping_types=None, regex=None, id=None, data=None, space=None, release_status=None):
2223
return EmbeddedMetadata.__init__(self, data=data, grouping_types=grouping_types, regex=regex)

fairgraph/openminds/core/data/hash.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ class Hash(EmbeddedMetadata, OMHash):
1717
type_ = "https://openminds.om-i.org/types/Hash"
1818
# forward properties are defined in the parent class (in openMINDS-Python)
1919
reverse_properties = []
20+
existence_query_properties = ("algorithm", "digest")
2021

2122
def __init__(self, algorithm=None, digest=None, id=None, data=None, space=None, release_status=None):
2223
return EmbeddedMetadata.__init__(self, data=data, algorithm=algorithm, digest=digest)

fairgraph/openminds/core/data/measurement.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ class Measurement(EmbeddedMetadata, OMMeasurement):
2020
type_ = "https://openminds.om-i.org/types/Measurement"
2121
# forward properties are defined in the parent class (in openMINDS-Python)
2222
reverse_properties = []
23+
existence_query_properties = ("measured_quantity", "values")
2324

2425
def __init__(
2526
self,

fairgraph/openminds/core/digital_identifier/stock_number.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ class StockNumber(EmbeddedMetadata, OMStockNumber):
1717
type_ = "https://openminds.om-i.org/types/StockNumber"
1818
# forward properties are defined in the parent class (in openMINDS-Python)
1919
reverse_properties = []
20+
existence_query_properties = ("identifier", "vendor")
2021

2122
def __init__(self, identifier=None, vendor=None, id=None, data=None, space=None, release_status=None):
2223
return EmbeddedMetadata.__init__(self, data=data, identifier=identifier, vendor=vendor)

fairgraph/openminds/core/miscellaneous/quantitative_value.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ class QuantitativeValue(EmbeddedMetadata, OMQuantitativeValue):
2020
type_ = "https://openminds.om-i.org/types/QuantitativeValue"
2121
# forward properties are defined in the parent class (in openMINDS-Python)
2222
reverse_properties = []
23+
existence_query_properties = ("value", "unit", "uncertainties")
2324

2425
def __init__(
2526
self,

0 commit comments

Comments
 (0)