-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy path02_04_ocrs_SimilaritySearch.ttl
140 lines (120 loc) · 5.9 KB
/
02_04_ocrs_SimilaritySearch.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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
@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.chemspider.com/api/#> .
@prefix ops_api_search: <http://www.chemspider.com/api/searchOptions#> .
@prefix ops_api_result: <http://www.chemspider.com/api/searchResultOptions#> .
@prefix ops_api_common: <http://www.chemspider.com/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:variable ops_api:searchResultOptions ;
api:dataset <http://www.chemspider.com> ;
api:description "An API configuration to return the result of a chemical similarity search." ;
api:endpoint [
a api:ExternalHTTPService ;
api:name "Chemical Structure Search: Similarity" ;
api:description "A set of ChemSpider compound URLs, similar to the input molecule according to the specified algorithm and threshold. Driven by ChemSpider." ;
api:enableCache false ;
api:uriTemplate "/structure/similarity?searchOptions.Molecule={searchOptions.Molecule}" ;
api:externalRequestTemplate "https://chemistry.openphacts.org/api/JSON.ashx?op=SimilaritySearch&CSCSearchScopeOptions.RealOnly=true&searchOptions.Molecule={searchOptions.Molecule}" ;
api:externalResponseHandler "converters/chemspider_structure_search_json_to_rdf.php" ;
api:exampleRequestPath "/structure/similarity?searchOptions.Molecule=CC(%3DO)Oc1ccccc1C(%3DO)O&searchOptions.Threshold=0.99&searchOptions.SimilarityType=Tanimoto" ;
api:viewer <#externalResponseViewer> ;
api:defaultViewer <#externalResponseViewer> . ] .
<http://www.chemspider.com> api:label "ChemSpider" .
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:SimilarityType ;
api:subType ops_api_search:Threshold ;
api:subType ops_api_search:Alpha ;
api:subType ops_api_search:Beta .
ops_api_search:SimilarityType api:name "SimilarityType" ;
api:label "SimilarityType" ;
api:value "0: Tanimoto ; 1: Tversky ; 2: Euclidian" .
ops_api_search:Alpha api:name "Alpha" ;
api:label "Alpha" ;
api:value "Value in [0,1] ; Default=0.5 ; available only for Tversky metric (for the other types it will be ignored) " .
ops_api_search:Beta api:name "Beta" ;
api:label "Beta" ;
api:value "Value in [0,1] ; Default=0.5 ; available only for Tversky metric (for the other types it will be ignored) " .
ops_api_search:Molecule api:name "Molecule" ;
api:label "Molecule" ;
api:value "A SMILES string. E.g. CC(=O)Oc1ccccc1C(=O)O" .
ops_api_search:Threshold api:name "Threshold" ;
api:label "Threshold" ;
api:value "Double <= 1.0" .
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" .
ops_api:searchResultOptions api:name "resultOptions" ;
api:label "resultOptions";
api:value "Possible search result option values" ;
api:subType ops_api_result:Start ;
api:subType ops_api_result:Count .
ops_api_result:Start api:name "Start" ;
api:label "Start" ;
api:value "Integer. Return results starting the index. Default value: 0" .
ops_api_result:Count api:name "Count" ;
api:label "Count" ;
api:value "Integer. How many results should be returned starting from Start index. Default value: -1." .
<#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:result ?result ;
ops_api_search:Threshold ?searchThreshold ;
ops_api_search:Alpha ?searchAlpha ;
ops_api_search:Beta ?searchBeta ;
ops_api_search:SimilarityType ?searchSimilarityType ;
ops_api_common:Complexity ?complexity ;
ops_api_common:Isotopic ?isotopic ;
ops_api_common:HasSpectra ?hasSpectra ;
ops_api_common:HasPatents ?hasPatents ;
ops_api_result:Start ?start ;
ops_api_result:Count ?count .
?result ops_api:relevance ?relevance .
" ;
api:where "
GRAPH <{result_hash}> {
?primaryTopic rdf:type ?searchType .
?primaryTopic ops_api_search:Molecule ?moleculeSmiles .
?primaryTopic ops_api:result ?result .
?result ops_api:relevance ?relevance .
OPTIONAL { ?primaryTopic ops_api_search:Threshold ?searchThreshold }
OPTIONAL { ?primaryTopic ops_api_search:SimilarityType ?searchSimilarityType }
OPTIONAL { ?primaryTopic ops_api_search:Alpha ?searchAlpha }
OPTIONAL { ?primaryTopic ops_api_search:Beta ?searchBeta }
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 }
OPTIONAL { ?primaryTopic ops_api_result:Start ?start }
OPTIONAL { ?primaryTopic ops_api_result:Count ?count }
}".