Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BioHackathon24 #8

Merged
merged 15 commits into from
Dec 16, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Adding ontop artifacts for hackathon.
Ubuntu committed Nov 29, 2024
commit 31a9adb22c61da66a1d10ff6f010950170909bf8
5 changes: 5 additions & 0 deletions hack24/catalog-v001.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<catalog prefer="public" xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
<uri id="Imports Wizard Entry" name="http://www.openmicroscopy.org/rdf/2016-06/ome_core/" uri="file:/home/ubuntu/repos/omero-ontop-mappings/ome-owl/ontology/owl/ome_core/ome_core.owl.ttl"/>
<group id="Folder Repository, directory=, recursive=true, Auto-Update=true, version=2" prefer="public" xml:base=""/>
</catalog>
129 changes: 129 additions & 0 deletions hack24/omemap.obda
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
[PrefixDeclaration]
: https://www.openmicroscopy.org/omemap/
dc: http://purl.org/dc/elements/1.1/
owl: http://www.w3.org/2002/07/owl#
rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns#
xml: http://www.w3.org/XML/1998/namespace
xsd: http://www.w3.org/2001/XMLSchema#
foaf: http://xmlns.com/foaf/0.1/
obda: https://w3id.org/obda/vocabulary#
rdfs: http://www.w3.org/2000/01/rdf-schema#
vcard: http://www.w3.org/2006/vcard/ns#
omemap: https://www.openmicroscopy.org/omemap#
ome_core: http://www.openmicroscopy.org/rdf/2016-06/ome_core/
ome_instance: https://example.org/site/

[MappingDeclaration] @collection [[
mappingId MAPID-project
target ome_instance:Project/{project_id} a ome_core:Project ; rdfs:label {project_name} ; rdfs:comment {project_description} ; ome_core:dataset ome_instance:Dataset/{dataset_id} ; <{map_key}> {map_value} .
source select
project.id as project_id,
projectannotationlink.child as annotation_id,
projectdatasetlink.child as dataset_id,
project.name as project_name,
project.description as project_description,
concat(annotation.ns, annotation_mapvalue.name) as map_key,
annotation_mapvalue.value as map_value
from project
join projectannotationlink on projectannotationlink.parent = project.id
join annotation on projectannotationlink.child = annotation.id
join annotation_mapvalue on annotation.id = annotation_mapvalue.annotation_id
join projectdatasetlink on project.id = projectdatasetlink.parent;

mappingId MAPID-dataset
target ome_instance:Dataset/{dataset_id} a ome_core:Dataset ; rdfs:label {dataset_name} ; rdfs:comment {dataset_description} ; ome_core:image ome_instance:Image/{image_id} ; <{map_key}> {map_value} .
source select
dataset.id as dataset_id,
datasetannotationlink.child as annotation_id,
datasetimagelink.child as image_id,
dataset.name as dataset_name,
dataset.description as dataset_description,
concat(annotation.ns, annotation_mapvalue.name) as map_key,
annotation_mapvalue.value as map_value,
annotation.textvalue as tag_text
from dataset
join datasetannotationlink on datasetannotationlink.parent = dataset.id
join annotation on datasetannotationlink.child = annotation.id
join annotation_mapvalue on annotation.id = annotation_mapvalue.annotation_id join datasetimagelink on dataset.id = datasetimagelink.parent;

mappingId MAPID-Image
target ome_instance:Image/{image_id} a ome_core:Image ; rdfs:label {image_name} ; rdfs:comment {image_description} ; <{map_key}> {map_value} ; ome_core:acquisitionDate {image_acquisitiondate}^^xsd:dateTime ; dc:identifier {image_id}^^xsd:string .
source select
image.id as image_id,
image.acquisitiondate as image_acquisitiondate,
imageannotationlink.child as annotation_id,
image.name as image_name,
image.description as image_description,
concat(annotation.ns, annotation_mapvalue.name) as map_key,
annotation_mapvalue.value as map_value
from image
join imageannotationlink on imageannotationlink.parent = image.id
join annotation on imageannotationlink.child = annotation.id
join annotation_mapvalue on annotation.id = annotation_mapvalue.annotation_id;

mappingId MAPID-experimentergroup
target ome_instance:ExperimenterGroup/{experimentergroup_id} a ome_core:ExperimenterGroup .
source select
experimentergroup.id as experimentergroup_id
from experimentergroup ;

mappingId MAPID-experiment
target ome_instance:Experiment/{experiment_id} a ome_core:Experiment .
source select
experiment.id as experiment_id
from experiment ;

mappingId MAPID-well
target ome_instance:Well/{well_id} a ome_core:Well .
source select
well.id as well_id
from well ;

mappingId MAPID-wellsample
target ome_instance:WellSample/{wellsample_id} a ome_core:WellSample .
source select
wellsample.id as wellsample_id
from wellsample ;

mappingId MAPID-reagentset
target ome_instance:ReagentSet/{reagentset_id} a ome_core:ReagentSet .
source select
reagent.id as reagentset_id
from reagent ;

mappingId MAPID-dataset_tag
target ome_instance:Dataset/{dataset_id} ome_core:tagAnnotationValue {tag_text} .
source select
dataset.id as dataset_id,
annotation.textvalue as tag_text
from dataset
join datasetannotationlink on datasetannotationlink.parent = dataset.id
join annotation on datasetannotationlink.child = annotation.id where annotation.textvalue is not NULL;

mappingId MAPID-image_tag
target ome_instance:Image/{image_id} ome_core:tagAnnotationValue {tag_text} .
source select
image.id as image_id,
annotation.textvalue as tag_text
from image
join imageannotationlink on imageannotationlink.parent = image.id
join annotation on imageannotationlink.child = annotation.id where annotation.textvalue is not NULL;

mappingId MAPID-project_tag
target ome_instance:Project/{project_id} ome_core:tagAnnotationValue {tag_text} .
source select
project.id as project_id,
annotation.textvalue as tag_text
from project
join projectannotationlink on projectannotationlink.parent = project.id
join annotation on projectannotationlink.child = annotation.id where annotation.textvalue is not NULL;

mappingId MAPID-a5bdd29d4c994a6bbb3acdc666403abd
target ome_instance:RegionOfInterest/{roi_id} a ome_core:RegionOfInterest ; dc:identifier {roi_id}^^xsd:string .
source select id as roi_id from roi;

mappingId MAPID-roi
target ome_instance:RegionOfInterest/{roi_id} a ome_core:RegionOfInterest ; ome_core:image ome_instance:Image/{roi_image_id} ; dc:identifier {roi_id}^^xsd:string .
source select id as roi_id, image as roi_image_id from roi ;
]]

5 changes: 5 additions & 0 deletions hack24/omemap.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#Thu Nov 14 21:58:37 CET 2024
jdbc.password=omero_db
jdbc.user=omero_db
jdbc.url=jdbc\:postgresql\://localhost\:5432/postgres
jdbc.driver=org.postgresql.Driver
78 changes: 78 additions & 0 deletions hack24/omemap.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
@prefix : <https://www.openmicroscopy.org/omemap/> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xml: <http://www.w3.org/XML/1998/namespace> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix obda: <https://w3id.org/obda/vocabulary#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix vcard: <http://www.w3.org/2006/vcard/ns#> .
@prefix omemap: <https://www.openmicroscopy.org/omemap#> .
@prefix ome_core: <http://www.openmicroscopy.org/rdf/2016-06/ome_core/> .
@prefix ome_instance: <https://example.org/site/> .
@base <https://www.openmicroscopy.org/omemap/> .

<https://www.openmicroscopy.org/omemap> rdf:type owl:Ontology ;
owl:imports ome_core: .

#################################################################
# Annotation properties
#################################################################

### http://www.openmicroscopy.org/rdf/2016-06/ome_core/annotation
ome_core:annotation rdf:type owl:AnnotationProperty .


### http://www.openmicroscopy.org/rdf/2016-06/ome_core/mapAnnotationValue
ome_core:mapAnnotationValue rdf:type owl:AnnotationProperty .


### http://www.openmicroscopy.org/rdf/2016-06/ome_core/nameSpace
ome_core:nameSpace rdf:type owl:AnnotationProperty .


#################################################################
# Object Properties
#################################################################

### http://www.openmicroscopy.org/rdf/2016-06/ome_core/mapAnnotationValue
ome_core:mapAnnotationValue rdfs:domain ome_core:Annotation ,
ome_core:LongAnnotation ,
ome_core:StructuredAnnotation .


#################################################################
# Data properties
#################################################################

### http://www.openmicroscopy.org/rdf/2016-06/ome_core/nameSpace
ome_core:nameSpace rdfs:domain ome_core:Annotation ,
ome_core:MapAnnotation .


### http://www.openmicroscopy.org/rdf/2016-06/ome_core/tagAnnotationValue
ome_core:tagAnnotationValue rdf:type owl:DatatypeProperty .


#################################################################
# Classes
#################################################################

### http://www.openmicroscopy.org/rdf/2016-06/ome_core/Dataset
ome_core:Dataset owl:disjointWith ome_core:Image .


### http://www.openmicroscopy.org/rdf/2016-06/ome_core/Folder
ome_core:Folder rdfs:subClassOf owl:Thing .


### http://www.openmicroscopy.org/rdf/2016-06/ome_core/Image
ome_core:Image owl:disjointWith ome_core:Project .


### http://www.openmicroscopy.org/rdf/2016-06/ome_core/StructuredAnnotation
ome_core:StructuredAnnotation rdfs:subClassOf ome_core:Annotation .


### Generated by the OWL API (version 4.5.25.2023-02-15T19:15:49Z) https://github.com/owlcs/owlapi
10 changes: 10 additions & 0 deletions hack24/run_ontop.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#! /bin/bash

# Spin up ontop
ontop endpoint \
-t omemap.ttl \
-m omemap.obda \
-p omemap.properties \
-x catalog-v001.xml \
--dev

2 changes: 1 addition & 1 deletion ome-owl