Skip to content
This repository was archived by the owner on Sep 9, 2025. It is now read-only.

Commit e5f9993

Browse files
authored
Merge pull request #51 from sdsc-ordes/feat/qlever-results
Feat/qlever results
2 parents 58656e5 + 17c5348 commit e5f9993

22 files changed

+869
-513
lines changed

docs/queries/result.rq

Lines changed: 94 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,100 @@
1-
PREFIX allores: <http://purl.allotrope.org/ontologies/result#>
2-
PREFIX cat: <http://example.org/catplus/ontology/>
3-
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
1+
PREFIX res: <http://dbpedia.org/resource/>
2+
PREFIX allo-res: <http://purl.allotrope.org/ontologies/result#>
43
PREFIX schema: <https://schema.org/>
5-
4+
PREFIX cat: <http://example.org/catplus/ontology/>
5+
PREFIX purl: <http://purl.allotrope.org/ontologies/>
66
SELECT
7-
?contentUrl
8-
?reactionType
9-
?chemicalName
7+
?contenturl ?deviceTypes ?chemicals ?peakIdentifiers
8+
WHERE {
9+
FILTER(
10+
CONTAINS(?chemicalNames, "Styrene") && CONTAINS(?chemicalNames, "methanol")
11+
&&
12+
CONTAINS(?casNumbers, "1") && CONTAINS(?casNumbers, "73")
13+
&&
14+
CONTAINS(?smiless, "O") && CONTAINS(?smiless, "OC")
15+
&&
16+
CONTAINS(?deviceTypes, "Oven")
17+
)
18+
{
19+
SELECT DISTINCT
20+
?contenturl
21+
?deviceTypes
22+
(GROUP_CONCAT(DISTINCT CONCAT(?chemicalName); separator=" | ") AS ?chemicalNames)
23+
(GROUP_CONCAT(DISTINCT CONCAT(?casNumber); separator=" | ") AS ?casNumbers)
24+
(GROUP_CONCAT(DISTINCT CONCAT(?smiles); separator=" | ") AS ?smiless)
25+
(GROUP_CONCAT(DISTINCT CONCAT(?chemicalName, " [", ?casNumber, "] <", ?smiles, ">"); separator=" | ") AS ?chemicals)
26+
?peakIdentifiers
1027
WHERE {
11-
?s schema:contentUrl ?contentUrl .
12-
?s cat:hasBatch ?batch .
13-
{?s cat:hasChemical ?chemical . ?s a cat:Campaign}
14-
UNION {?action cat:hasBatch ?batch . ?action cat:hasSample* ?sample . ?sample cat:hasChemical ?chemical .}
15-
?batch cat:reactionType ?reactionType .
16-
?chemical allores:AFR_0002292 ?chemicalName .
28+
# Step 1: Pagination of contenturl
29+
{
30+
SELECT DISTINCT ?contenturl
31+
WHERE {
32+
?LiquidChromatographyAggregateDocument schema:contentUrl ?contenturl .
33+
?LiquidChromatographyAggregateDocument a allo-res:AFR_0002524 .
34+
}
35+
ORDER BY ?contenturl
36+
LIMIT 10
37+
OFFSET 0
38+
}
39+
# Step 2: Get deviceType per contenturl
1740
{
18-
SELECT DISTINCT ?s WHERE {
19-
?batch cat:reactionType ?reactionType .
20-
?s rdf:type cat:Campaign .
21-
?s cat:hasBatch ?batch .
22-
{?s cat:hasChemical ?chemical . ?s a cat:Campaign}
23-
UNION {?action cat:hasBatch ?batch . ?action cat:hasSample* ?sample . ?sample cat:hasChemical ?chemical .}
24-
?s schema:contentUrl ?contentUrl .
25-
FILTER (?reactionType IN ('N-methylation'))
26-
}
27-
ORDER BY ASC(?contentUrl)
28-
LIMIT 3
29-
OFFSET 0
41+
SELECT ?contenturl (GROUP_CONCAT(DISTINCT ?deviceType; separator=", ") AS ?deviceTypes )
42+
WHERE {
43+
?LiquidChromatographyAggregateDocument schema:contentUrl ?contenturl ;
44+
allo-res:AFR_0002526 ?DeviceSystemDocument ;
45+
cat:hasLiquidChromatography/allo-res:AFR_0002374 ?MeasurementAggregateDocument .
46+
?DeviceSystemDocument a cat:DeviceSystemDocument ;
47+
allo-res:AFR_0002722/allo-res:AFR_0002568 ?deviceType .
48+
?MeasurementAggregateDocument allo-res:AFR_0002083 ?SampleDocument .
49+
?SampleDocument cat:hasProduct ?product .
50+
?synthAddAction cat:producesProduct ?product ;
51+
cat:hasBatch ?batch .
52+
?batch cat:reactionType ?reactionType ;
53+
cat:reactionName ?reactionName .
54+
FILTER(CONTAINS(?reactionType, "N-methylation"))
55+
FILTER(CONTAINS(?reactionName, "Caffeine synthesis"))
56+
}
57+
GROUP BY ?contenturl
58+
59+
}
60+
# Step 3: Chemical info coming from campaigns and samples
61+
{
62+
SELECT ?contenturl ?chemical ?casNumber ?smiles ?chemicalName
63+
WHERE {
64+
?LiquidChromatographyAggregateDocument schema:contentUrl ?contenturl ;
65+
cat:hasLiquidChromatography/allo-res:AFR_0002374 ?MeasurementAggregateDocument .
66+
?MeasurementAggregateDocument allo-res:AFR_0002083 ?SampleDocument .
67+
?SampleDocument cat:hasProduct ?product .
68+
?synthaddaction cat:producesProduct ?product .
69+
?synthaddaction cat:hasBatch ?batch .
70+
?campaign cat:hasBatch ?batch .
71+
{?synthaddaction cat:hasSample+ ?sample .
72+
?sample cat:hasChemical ?chemical .
73+
}
74+
UNION {
75+
?campaign cat:hasChemical ?chemical .
76+
}
77+
?campaign schema:name ?campaignName .
78+
FILTER(CONTAINS(?campaignName, "Caffeine Synthesis"))
79+
80+
?chemical
81+
allo-res:AFR_0002292 ?chemicalName ;
82+
cat:casNumber ?casNumber ;
83+
allo-res:AFR_0002295 ?smiles .
84+
}
85+
GROUP BY ?contenturl ?chemical ?casNumber ?smiles ?chemicalName
86+
}
87+
# Step 4: Peak Identifiers
88+
{
89+
SELECT ?contenturl (GROUP_CONCAT(DISTINCT ?peakIdentifier; separator=", ") AS ?peakIdentifiers)
90+
WHERE {
91+
?LiquidChromatographyAggregateDocument schema:contentUrl ?contenturl ;
92+
cat:hasLiquidChromatography/allo-res:AFR_0002374 ?MeasurementAggregateDocument .
93+
?MeasurementAggregateDocument allo-res:AFR_0002659/allo-res:AFR_0000432/cat:peak/allo-res:AFR_0001164 ?peakIdentifier .
3094
}
95+
GROUP BY ?contenturl
96+
}
3197
}
32-
GROUP BY ?contentUrl ?reactionType ?chemicalName
33-
ORDER BY ASC(?contentUrl)
98+
GROUP BY ?contenturl ?deviceTypes ?peakIdentifiers
99+
}}
100+
ORDER BY ASC(?contenturl)

src/lib/components/Campaign.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
rel="noopener noreferrer"
5656
>
5757
<FolderDown />
58-
<span>Download ZIP {getZipFileName(title)}</span>
58+
<span>Download ZIP {getZipFileName(activeCampaign)}</span>
5959
</a>
6060
</h1>
6161
</div>

src/lib/components/ContentLayout.svelte

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,14 @@
1212
<div class="grid grid-cols-1 md:grid-cols-[theme(spacing.96)_1fr]">
1313
<!-- Left Sidebar. -->
1414
<aside class="p-4 overflow-y-auto">
15-
{@render sidebar()}
15+
{#if sidebar}
16+
{@render sidebar()}
17+
{/if}
1618
</aside>
1719
<!-- Main Content -->
1820
<main class="space-y-4 p-4 overflow-y-auto">
19-
{@render main()}
21+
{#if main}
22+
{@render main()}
23+
{/if}
2024
</main>
2125
</div>

0 commit comments

Comments
 (0)