ivci:nuva-utils

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
ivci:nuva-utils [2024/01/05 13:54] fkaagivci:nuva-utils [2024/03/20 13:21] (current) fkaag
Line 43: Line 43:
 Runs a SPARQL query q against a graph formed by merging **nuva_core.ttl** and the work file **nuva_code_YYY.ttl**, thus allowing to run checks and measures on the alignment. Runs a SPARQL query q against a graph formed by merging **nuva_core.ttl** and the work file **nuva_code_YYY.ttl**, thus allowing to run checks and measures on the alignment.
  
 +
 +<code>
 +eval_code(code)
 +</code>
 +Produces the metrics for a code system, given a **nuva_code_YYY.csv** file for alignments.
 +
 +Subproducts are:
 +  * **nuva_reverse_YYY.csv** : file with all NUVA codes matching a given external code
 +  * **nuva_best_YYY.csv**: file with the best possible external code for a given NUVA code
  
 An example use sequence is included in the file: An example use sequence is included in the file:
Line 55: Line 64:
 map_to_turtle("CVX") map_to_turtle("CVX")
  
-q1 = """ += """ 
    # All vaccines against smallpox    # All vaccines against smallpox
     SELECT ?vcode ?vl WHERE {      SELECT ?vcode ?vl WHERE { 
Line 67: Line 76:
  }  }
 """ """
-res = query_core(q1)+res = query_core(q)
 for row in res: for row in res:
-    print (str(row[0])+"-"+str(row[1]))+     print (f"{row.vcode} - {row.vl}"
 + 
 +res = eval_code("CVX"
 +print ("Completeness {:.1%} ".format(res['Completeness'])
 +print ("Precision {:.1%} ".format(res['Precision']))
  
-q2=""" 
-    # List CVX Codes 
-    SELECT ?cvx ?nuva ?lvac WHERE {  
-    ?vac rdfs:subClassOf nuva:Vaccine .  
-    ?vac skos:notation ?nuva . 
-    ?vac skos:exactMatch ?code . 
-    ?code rdfs:subClassOf nuva:CVX . 
-    ?code skos:notation ?cvx . 
-    ?vac rdfs:label $lvac 
-    } 
-""" 
-res=query_code(q2,"CVX") 
-for row in res: 
-    print ("CVX "+str(row[0])+" = "+str(row[1])+" : "+str(row[2])) 
 </code> </code>
  
  • ivci/nuva-utils.1704462878.txt.gz
  • Last modified: 2024/01/05 13:54
  • by fkaag