Closed syphax-bouazzouni closed 1 year ago
If inside the class/concepts defintion are defined mapping relations (need to be defined and listed), we should extract them and add them to the mapping list of the class/concept.
Actually they are only showed the class/concept details
is to upgrade the SPARQL query used to fetch the mapping, defined in def self.mappings_ontologies(sub1, sub2, page, size, classId = nil, reload_cache = false)
The request will go from
SELECT DISTINCT ?s1 ?s2 ?g ?source ?o WHERE { { GRAPH <http://data.bioontology.org/ontologies/E-PHY/submissions/1> { ?s1 <http://bioportal.bioontology.org/ontologies/umls/cui> ?o . } GRAPH ?g { ?s2 <http://bioportal.bioontology.org/ontologies/umls/cui> ?o . } BIND ('CUI' AS ?source) } UNION { GRAPH <http://data.bioontology.org/ontologies/E-PHY/submissions/1> { ?s1 <http://data.bioontology.org/metadata/def/mappingSameURI> ?o . } GRAPH ?g { ?s2 <http://data.bioontology.org/metadata/def/mappingSameURI> ?o . } BIND ('SAME_URI' AS ?source } UNION { GRAPH <http://data.bioontology.org/ontologies/E-PHY/submissions/1> { ?s1 <http://data.bioontology.org/metadata/def/mappingLoom> ?o . } GRAPH ?g { ?s2 <http://data.bioontology.org/metadata/def/mappingLoom> ?o . } BIND ('LOOM' AS ?source) } UNION { GRAPH <http://data.bioontology.org/ontologies/E-PHY/submissions/1> { ?s1 <http://data.bioontology.org/metadata/def/mappingRest> ?o . } GRAPH ?g { ?s2 <http://data.bioontology.org/metadata/def/mappingRest> ?o . } BIND ('REST' AS ?source)} } FILTER ((?s1 != ?s2) || (?source = 'SAME_URI')) FILTER (!STRSTARTS(str(?g),'http://data.bioontology.org/ontologies/E-PHY')) } OFFSET 0 LIMIT 50
To
SELECT DISTINCT ?s1 ?s2 ?g ?source ?o WHERE { { GRAPH <http://data.bioontology.org/ontologies/E-PHY/submissions/1> { ?s1 <http://bioportal.bioontology.org/ontologies/umls/cui> ?o . } GRAPH ?g { ?s2 <http://bioportal.bioontology.org/ontologies/umls/cui> ?o . } BIND ('CUI' AS ?source) } UNION { GRAPH <http://data.bioontology.org/ontologies/E-PHY/submissions/1> { ?s1 <http://data.bioontology.org/metadata/def/mappingSameURI> ?o . } GRAPH ?g { ?s2 <http://data.bioontology.org/metadata/def/mappingSameURI> ?o . } BIND ('SAME_URI' AS ?source } UNION { GRAPH <http://data.bioontology.org/ontologies/E-PHY/submissions/1> { ?s1 <http://data.bioontology.org/metadata/def/mappingLoom> ?o . } GRAPH ?g { ?s2 <http://data.bioontology.org/metadata/def/mappingLoom> ?o . } BIND ('LOOM' AS ?source) } UNION { GRAPH <http://data.bioontology.org/ontologies/E-PHY/submissions/1> { ?s1 <http://data.bioontology.org/metadata/def/mappingRest> ?o . } GRAPH ?g { ?s2 <http://data.bioontology.org/metadata/def/mappingRest> ?o . } BIND ('REST' AS ?source)} } UNION { GRAPH <http://data.bioontology.org/ontologies/E-PHY/submissions/1> { ?s1 <http://data.bioontology.org/metadata/def/mappingRest> ?o . } GRAPH ?g { ?s2 <http://data.bioontology.org/metadata/def/mappingRest> ?o . } BIND ('REST' AS ?source)} } UNION { GRAPH <http://data.bioontology.org/ontologies/E-PHY/submissions/1> { ?s1 <http://www.w3.org/2004/02/skos/core#exactMatch> ?s2 . } BIND( <http://data.bioontology.org/ontologies/E-PHY/submissions/1> as ?g) BIND( ?s2 AS ?o) BIND ('SKOS:EXACT_MATCH' AS ?source) } FILTER ((?s1 != ?s2) || (?source = 'SAME_URI')) FILTER (!STRSTARTS(str(?g),'http://data.bioontology.org/ontologies/E-PHY') || ((?source = 'SKOS:EXACT_MATCH'))) } OFFSET 0 LIMIT 50
Note for later : we will need to add alos: owl:sameAs and oboInOwl:hasDbXref has not.
Requirement
If inside the class/concepts defintion are defined mapping relations (need to be defined and listed), we should extract them and add them to the mapping list of the class/concept.
Actually they are only showed the class/concept details
The proposed solution
is to upgrade the SPARQL query used to fetch the mapping, defined in def self.mappings_ontologies(sub1, sub2, page, size, classId = nil, reload_cache = false)
The request will go from
To
TODO