Skip to content

Commit

Permalink
Modifying tests to comply with fix for #18.
Browse files Browse the repository at this point in the history
  • Loading branch information
Carsten committed Dec 21, 2024
1 parent 488634e commit 8573054
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 40 deletions.
72 changes: 34 additions & 38 deletions ontop/omemap.obda
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,17 @@ target ome_instance:Project/{project_id} a ome_core:Project ; <{map_key}> {map_
source select
_project.id as project_id,
concat(regexp_replace(regexp_replace(
case
when _annotation.ns is null then 'http://www.openmicroscopy.org/ns/default/'
else
case
when starts_with(_annotation.ns, 'http') then _annotation.ns
when starts_with(_annotation.ns, '/') then regexp_replace(_annotation.ns, '^[\/]*', 'http://')
else concat('http://', _annotation.ns)
end
end,
'([^\/,#])$',
'\1/'
), '\s', '_') ,
case
when _annotation.ns is null then 'http://www.openmicroscopy.org/ns/default/'
else
case
when regexp_like(_annotation.ns, '^http[s]{0,1}:\/\/') then _annotation.ns
else 'http://www.openmicroscopy.org/ns/default/'
end
end,
'([^\/,#])$',
'\1/'
), '\s', '_'),
_annotation_mapvalue.name) as map_key,
_annotation_mapvalue.value as map_value
from project as _project
Expand Down Expand Up @@ -76,20 +75,18 @@ target ome_instance:Dataset/{dataset_id} <{map_key}> {map_value}^^xsd:string .
source select
_dataset.id as dataset_id,
_datasetannotationlink.child as annotation_id,
concat(regexp_replace(regexp_replace(
case
when _annotation.ns is null then 'http://www.openmicroscopy.org/ns/default/'
else
case
when starts_with(_annotation.ns, 'http') then _annotation.ns
when starts_with(_annotation.ns, '/') then regexp_replace(_annotation.ns, '^[\/]*', 'http://')
else concat('http://', _annotation.ns)
end
end,
'([^\/,#])$',
'\1/'
), '\s', '_'),
_annotation_mapvalue.name) as map_key,
concat(regexp_replace(regexp_replace(
case
when _annotation.ns is null then 'http://www.openmicroscopy.org/ns/default/'
else
case
when regexp_like(_annotation.ns, '^http[s]{0,1}:\/\/') then _annotation.ns
else 'http://www.openmicroscopy.org/ns/default/'
end
end,
'([^\/,#])$',
'\1/'
), '\s', '_'), _annotation_mapvalue.name) as map_key,
_annotation_mapvalue.value as map_value
from dataset as _dataset
join datasetannotationlink as _datasetannotationlink on _datasetannotationlink.parent = _dataset.id
Expand All @@ -110,18 +107,17 @@ target ome_instance:Image/{image_id} a ome_core:Image; <{map_key}> {map_value}^
source select
_image.id as image_id,
concat(regexp_replace(regexp_replace(
case
when _annotation.ns is null then 'http://www.openmicroscopy.org/ns/default/'
else
case
when starts_with(_annotation.ns, 'http') then _annotation.ns
when starts_with(_annotation.ns, '/') then regexp_replace(_annotation.ns, '^[\/]*', 'http://')
else concat('http://', _annotation.ns)
end
end,
'([^\/,#])$',
'\1/'
), '\s', '_'),
case
when _annotation.ns is null then 'http://www.openmicroscopy.org/ns/default/'
else
case
when regexp_like(_annotation.ns, '^http[s]{0,1}:\/\/') then _annotation.ns
else 'http://www.openmicroscopy.org/ns/default/'
end
end,
'([^\/,#])$',
'\1/'
), '\s', '_'),
_annotation_mapvalue.name) as map_key,
_annotation_mapvalue.value as map_value
from image as _image
Expand Down
4 changes: 2 additions & 2 deletions test/test_queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ def test_namespace_fixing_issue16(self):
PREFIX ome_ns: <http://www.openmicroscopy.org/ns/default/>
SELECT DISTINCT * WHERE {
image:10 <http://hms.harvard.edu/omero/forms/kvdata/MPB_Annotations/Assay> ?assay .
image:10 ome_ns:Assay ?assay .
}
"""
response_df = run_query(query)
Expand All @@ -486,7 +486,7 @@ def test_namespace_fixing_issue17(self):
PREFIX ome_ns: <http://www.openmicroscopy.org/ns/default/>
SELECT DISTINCT * WHERE {
image:9 <http://MouseCT/Skyscan/System/Assay> ?assay .
image:9 ome_ns:Assay ?assay .
}
"""
response_df = run_query(query)
Expand Down

0 comments on commit 8573054

Please sign in to comment.