Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
ivci:nuva-utils [2024/01/05 13:54] – fkaag | ivci: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**, | Runs a SPARQL query q against a graph formed by merging **nuva_core.ttl** and the work file **nuva_code_YYY.ttl**, | ||
+ | |||
+ | < | ||
+ | eval_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**: | ||
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(" | map_to_turtle(" | ||
- | q1 = """ | + | q = """ |
# 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 (f"{row.vcode} - {row.vl}" |
+ | |||
+ | res = eval_code(" | ||
+ | print (" | ||
+ | print ("Precision {: | ||
- | q2=""" | ||
- | # List CVX Codes | ||
- | SELECT ?cvx ?nuva ?lvac WHERE { | ||
- | ?vac rdfs: | ||
- | ?vac skos: | ||
- | ?vac skos: | ||
- | ?code rdfs: | ||
- | ?code skos: | ||
- | ?vac rdfs:label $lvac | ||
- | } | ||
- | """ | ||
- | res=query_code(q2," | ||
- | for row in res: | ||
- | print ("CVX " | ||
</ | </ | ||