-
Notifications
You must be signed in to change notification settings - Fork 7
/
02_06_ocrs_ExactStructureSearch.ttl
98 lines (84 loc) · 4.17 KB
/
02_06_ocrs_ExactStructureSearch.ttl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
@base <http://www.openphacts.org/api> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix api: <http://purl.org/linked-data/api/vocab#> .
@prefix ops_api: <http://www.openphacts.org/api/#> .
@prefix ops_api_search: <http://www.openphacts.org/api/searchOptions#> .
@prefix ops_api_result: <http://www.openphacts.org/api/resultOptions#> .
@prefix ops_api_common: <http://www.openphacts.org/api/commonOptions#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
<#chemspider> a api:API ;
rdfs:label "ChemSpider structure search"@en;
api:sparqlEndpoint <http://alpha.openphacts.org:8890/sparql/> ;
api:contentNegotiation api:parameterBased ;
api:variable ops_api:searchOptions ;
api:variable ops_api:commonOptions ;
api:dataset <http://chemistry.openphacts.org> ;
api:description "An API configuration to return the result of an exact chemical structure search." ;
api:endpoint [
a api:ExternalHTTPService ;
api:description "A ChemSpider URL corresponding to an input SMILES string. Driven by ChemSpider." ;
api:name "Chemical Structure Search: Exact" ;
api:enableCache true ;
api:uriTemplate "/structure/exact?searchOptions.Molecule={searchOptions.Molecule}" ;
api:externalRequestTemplate "https://chemistry.openphacts.org/api/JSON.ashx?op=ExactStructureSearch&CSCSearchScopeOptions.RealOnly=true&searchOptions.Molecule={searchOptions.Molecule}" ;
api:externalResponseHandler "converters/chemspider_structure_search_json_to_rdf.php" ;
api:exampleRequestPath "/structure/exact?searchOptions.Molecule=CNC(%3DO)c1cc(ccn1)Oc2ccc(cc2)NC(%3DO)Nc3ccc(c(c3)C(F)(F)F)Cl" ;
api:viewer <#externalResponseViewer> ;
api:defaultViewer <#externalResponseViewer> . ] .
<http://chemistry.openphacts.org> api:label "OpenPHACTS Chemistry Registration Service" .
ops_api:searchOptions api:name "searchOptions" ;
api:label "searchOptions" ;
api:value "Possible search option values" ;
api:subType ops_api_search:Molecule ;
api:subType ops_api_search:MatchType .
ops_api_search:Molecule api:name "Molecule" ;
api:label "Molecule" ;
api:value "A SMILES string. E.g. CNC(=O)c1cc(ccn1)Oc2ccc(cc2)NC(=O)Nc3ccc(c(c3)C(F)(F)F)Cl" .
ops_api_search:MatchType api:name "MatchType" ;
api:label "MatchType" ;
api:value "0: ExactMatch ; 1: AllTautomers ; 2: SameSkeletonIncludingH ; 3: SameSkeletonExcludingH ; 4: AllIsomers" .
ops_api:commonOptions api:name "commonOptions" ;
api:label "commonOptions";
api:value "Possible common option values" ;
api:subType ops_api_common:Complexity ;
api:subType ops_api_common:Isotopic ;
api:subType ops_api_common:HasSpectra ;
api:subType ops_api_common:HasPatents .
ops_api_common:Complexity api:name "Complexity" ;
api:label "Complexity";
api:value "(Not supported at the moment) 0: Any ; 1: Single ; 2: Multi" .
ops_api_common:Isotopic api:name "Isotopic" ;
api:label "Isotopic" ;
api:value "(Not supported at the moment) 0: Any ; 1: Labeled ; 2: NotLabeled" .
ops_api_common:HasSpectra api:name "HasSpectra" ;
api:label "HasSpectra" ;
api:value "(Not supported at the moment) Boolean" .
ops_api_common:HasPatents api:name "HasPatents" ;
api:label "HasPatents" ;
api:value "(Not supported at the moment) Boolean" .
<#externalResponseViewer> a api:Viewer ;
api:name "externalResponseViewer" ;
api:template "
{pageUri} foaf:primaryTopic ?primaryTopic .
?primaryTopic foaf:isPrimaryTopicOf {pageUri} .
?primaryTopic rdf:type ?searchType ;
ops_api_search:Molecule ?moleculeSmiles ;
ops_api_search:MatchType ?searchMatchType ;
ops_api:result ?result ;
ops_api_common:Complexity ?complexity ;
ops_api_common:Isotopic ?isotopic ;
ops_api_common:HasSpectra ?hasSpectra ;
ops_api_common:HasPatents ?hasPatents .
" ;
api:where "
GRAPH <{result_hash}> {
?primaryTopic rdf:type ?searchType .
?primaryTopic ops_api_search:Molecule ?moleculeSmiles .
?primaryTopic ops_api:result ?result .
OPTIONAL { ?primaryTopic ops_api_search:MatchType ?searchMatchType }
OPTIONAL { ?primaryTopic ops_api_common:Complexity ?complexity }
OPTIONAL { ?primaryTopic ops_api_common:Isotopic ?isotopic }
OPTIONAL { ?primaryTopic ops_api_common:HasSpectra ?hasSpectra }
OPTIONAL { ?primaryTopic ops_api_common:HasPatents ?hasPatents }
}".