tetherless-world / nanomine-graph

the visualization web app for nanomine project
MIT License
1 stars 4 forks source link

How to retrieve Processing info for a sample? #25

Closed mdeagen closed 4 years ago

mdeagen commented 4 years ago

The following SPARQL query:

PREFIX nm: <http://nanomine.org/ns/>
SELECT * WHERE {
  ?x ?y nm:SolutionProcessing 
} 

returns 0 results in the Knowledge Graph (both in QA and prod).

Have the most recent SETL scripts been merged with either QA or production?

mdeagen commented 4 years ago

Update: found the processing steps information (see below). Do we also store the broader processing category, such as SolutionProcessing, MeltMixing, etc?

PREFIX sio: <http://semanticscience.org/resource/>
SELECT * WHERE {
  ?x a sio:Procedure ;
     sio:hasPart [ a ?y ]
} 
rashidsabbir commented 4 years ago

For solution processing, I would write the following query, which I confirmed works with the latest setlr file:

PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX nm: <http://nanomine.org/ns/>
PREFIX sio: <http://semanticscience.org/resource/>
SELECT DISTINCT * WHERE {
  ?procedure rdf:type nm:SolutionProcessing ;
             sio:hasPart ?step .
  ?part sio:hasInput ?input ;
        sio:hasOutput ?output ;
        sio:hasParameter ?param .
  ?param rdf:type ?paramType ;
         sio:hasAttribute ?paramAttr .
  OPTIONAL{?paramAttr sio:hasValue ?attrVal .}
  OPTIONAL{?paramAttr dc:description ?attrDesc .}
  OPTIONAL{?paramAttr sio:hasUnit ?attrUnit .}
  OPTIONAL{?paramAttr sio:hasAttribute ?attrUncertainty .}
} 

Instead of searching directly for nm:SolutionProcessing, you can do ?procedure rdf:type ?processingType which returns the other processing types, such as MeltMixing, as well.