File tree 5 files changed +65
-18
lines changed
easy-rdf-endpoint/setup/rdflib-endpoint
5 files changed +65
-18
lines changed Original file line number Diff line number Diff line change @@ -13,16 +13,16 @@ ALLOWED_ORIGINS=*
13
13
CATALOG_FILE = catalog.rdf
14
14
15
15
# SPARQL Query Configuration
16
- DEFAULT_SPARQL_QUERY = " PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>\n PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\n SELECT * WHERE {\n ?s ?p ?o .\n } LIMIT 100"
16
+ DEFAULT_SPARQL_QUERY = " PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>\n PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\n PREFIX dct: <http://purl.org/dc/terms/> \n PREFIX dcat: <http://www.w3.org/ns/dcat#> \n\ n SELECT DISTINCT ?subject ?label ?type ?description WHERE {\n ?subject rdf:type ?type .\n OPTIONAL { ?subject rdfs:label ?label } \n OPTIONAL { ?subject dct:description ?description } \n } \n ORDER BY ?type ?label \n LIMIT 100"
17
17
EXAMPLE_SPARQL_QUERIES = '{
18
18
"HVD info": {
19
- "query": "prefix dct: <http://purl.org/dc/terms/>\nprefix dcatap: <http://data.europa.eu/r5r/>\nprefix dcat: <http://www.w3.org/ns/dcat#>\n\nselect distinct ?title ?hvdCategory ?applicableLegislation ?accessService ?accessURL ?license\nwhere {\n # Filtrar por catálogos ES\n ?catalogo ?cp ?d.\n\n # Dataset y su categoría HVD\n ?d dcatap:applicableLegislation <http://data.europa.eu/eli/reg_impl/2023/138/oj>.\n ?d a dcat:Dataset.\n optional { ?d dcatap:hvdCategory ?hvdCategory. }\n \n # Distribución y sus propiedades\n ?d dcat:distribution ?dist.\n ?dist dcatap:applicableLegislation <http://data.europa.eu/eli/reg_impl/2023/138/oj>.\n \n optional { \n ?dist dct:title ?title.\n FILTER(langMatches(lang(?title), \"es\"))\n } \n optional { ?dist dcatap:applicableLegislation ?applicableLegislation. } \n optional { ?dist dcat:accessURL ?accessURL. } \n optional { ?dist dcat:accessService ?accessService. } \n optional { ?dist dct:license ?license. } \n}\nORDER BY ?dist"
19
+ "query": "prefix dct: <http://purl.org/dc/terms/>\nprefix dcatap: <http://data.europa.eu/r5r/>\nprefix dcat: <http://www.w3.org/ns/dcat#>\n\nselect distinct ?title ?hvdCategory ?applicableLegislation ?accessService ?accessURL ?license\nwhere {\n ?catalogo ?cp ?d.\n\n # Dataset y su categoría HVD\n ?d dcatap:applicableLegislation <http://data.europa.eu/eli/reg_impl/2023/138/oj>.\n ?d a dcat:Dataset.\n optional { ?d dcatap:hvdCategory ?hvdCategory. }\n \n # Distribution and its props\n ?d dcat:distribution ?dist.\n ?dist dcatap:applicableLegislation <http://data.europa.eu/eli/reg_impl/2023/138/oj>.\n \n optional { \n ?dist dct:title ?title.\n FILTER(langMatches(lang(?title), \"en\"))\n } \n optional { ?dist dcatap:applicableLegislation ?applicableLegislation. } \n optional { ?dist dcat:accessURL ?accessURL. } \n optional { ?dist dcat:accessService ?accessService. } \n optional { ?dist dct:license ?license. } \n}\nORDER BY ?dist"
20
20
},
21
- "Query types ": {
22
- "query": "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>\nSELECT DISTINCT ?type WHERE {\n ?s rdf:type ?type\n} LIMIT 10 "
21
+ "Count stats ": {
22
+ "query": "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>\nPREFIX dcat: <http://www.w3.org/ns/dcat#>\nPREFIX dct: <http://purl.org/dc/terms/>\n\ nSELECT \n (COUNT( DISTINCT ?dataset) AS ?totalDatasets)\n (COUNT(DISTINCT ?distribution) AS ?totalDistributions)\n (COUNT(DISTINCT ?dataservice) AS ?totalDataservices)\n (COUNT(DISTINCT ?publisher) AS ?totalPublishers)\nWHERE {\n {\n ?dataset a dcat:Dataset .\n OPTIONAL { ?dataset dct:publisher ?publisher }\n OPTIONAL { ?dataset dcat:distribution ?distribution }\n }\n UNION\n {\n ?dataservice a dcat:DataService ;\n dcat:servesDataset ?dataset .\n }\n} "
23
23
},
24
- "Count triples ": {
25
- "query": "SELECT (COUNT(*) AS ?count) WHERE {\n ?s ?p ?o .\n} "
24
+ "Query types ": {
25
+ "query": "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>\nPREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\nPREFIX dct: <http://purl.org/dc/terms/>\nSELECT DISTINCT ?type ?label (COUNT(?s) as ?count) ?comment WHERE {\n ?s rdf:type ?type .\n OPTIONAL { ?type rdfs:label ?label }\n OPTIONAL { ?type rdfs:comment ?comment }\n} \nGROUP BY ?type ?label ?comment\nORDER BY DESC(?count)\nLIMIT 10 "
26
26
}
27
27
}'
28
28
SPARQL_ENDPOINT_TITLE = " RDF SPARQL Endpoint-Catalog"
Original file line number Diff line number Diff line change 16
16
< div class ="header-container ">
17
17
< h1 class ="text-primary "> SPARQL Search</ h1 >
18
18
< div class ="badges-container ">
19
- < a href ="/catalog " target ="_blank " class ="badge badge-rdf ">
20
- < img src ="/img/format/rdf.svg " alt ="RDF icon " class ="badge-icon ">
21
- Download RDF Catalog
19
+ < a href ="/ " target ="_self " class ="badge badge-home " data-title ="Return to homepage ">
20
+ < img src ="/img/home.svg " alt ="Home icon " class ="badge-icon home-icon ">
22
21
</ a >
23
- < a href ="/sparql " target ="_blank " class ="badge badge-sparql ">
22
+ < a href ="/sparql " target ="_blank " class ="badge badge-sparql " data-title =" Access the machine-readable SPARQL endpoint " >
24
23
< img src ="/img/sparql.svg " alt ="SPARQL icon " class ="badge-icon ">
25
24
SPARQL Endpoint
26
25
</ a >
26
+ < a href ="/catalog " target ="_blank " class ="badge badge-rdf " data-title ="Download the complete RDF catalog file ">
27
+ < img src ="/img/format/rdf.svg " alt ="RDF icon " class ="badge-icon ">
28
+ RDF Catalog
29
+ </ a >
27
30
</ div >
28
31
</ div >
29
32
< div class ="description ">
@@ -38,6 +41,7 @@ <h1 class="text-primary">SPARQL Search</h1>
38
41
< code id ="endpoint-url " title ="Click to copy "> </ code >
39
42
</ li >
40
43
</ ul >
44
+ < br >
41
45
< p >
42
46
To assist users in constructing useful SPARQL queries, the < a href ="https://dataeuropa.gitlab.io/data-provider-manual/ "> European Data Portal (EDP)</ a > provide featured
43
47
< a href ="https://data.europa.eu/about/sparql "> sample SPARQL queries </ a > that can be executed via our endpoint.
Original file line number Diff line number Diff line change @@ -98,8 +98,8 @@ code#endpoint-url:hover {
98
98
}
99
99
100
100
code # endpoint-url .copy-icon {
101
- width : 25 px ;
102
- height : 25 px ;
101
+ width : 20 px ;
102
+ height : 20 px ;
103
103
margin : 0 auto;
104
104
}
105
105
Original file line number Diff line number Diff line change 36
36
margin-bottom : 2rem ;
37
37
line-height : 1.6 ;
38
38
}
39
+ .yasgui .tabsList .tab .active a {
40
+ border-bottom-color : var (--primary-color );
41
+ color : var (--primary-color );
42
+ font-weight : bold;
43
+ }
39
44
# yasgui {
40
45
width : 100% ;
41
46
height : 600px ;
42
- border : 1px solid # ddd ;
43
- border-radius : 4px ;
44
- margin-top : 2rem ;
45
- }
46
- .yasgui .yasqe {
47
- height : 400px !important ;
47
+ margin-top : 1rem ;
48
48
}
49
49
.yasgui .yasr {
50
50
height : 200px !important ;
85
85
color : # 6f6f6f ;
86
86
font-weight : bold;
87
87
font-size : 14px ;
88
+ }
89
+
90
+ .badge-home {
91
+ background-color : # 9da2a740 ;
92
+ color : # 6f6f6f ;
93
+ font-weight : bold;
94
+ font-size : 14px ;
95
+ margin-right : 0 ;
96
+ }
97
+ .badge-icon .home-icon {
98
+ margin : 0 ;
99
+ padding : 0 ;
100
+ width : 24px ;
101
+ height : 24px ;
102
+ }
103
+
104
+ .badge-home : hover .badge-icon .home-icon {
105
+ filter : brightness (10 );
106
+ }
107
+
108
+ .badge-home : hover {
109
+ background-color : var (--primary-color );
110
+ color : white;
111
+ }
112
+
113
+ .badge {
114
+ position : relative;
115
+ }
116
+
117
+ .badge [data-title ]: hover ::after {
118
+ content : attr (data-title);
119
+ position : absolute;
120
+ bottom : -26px ;
121
+ left : 50% ;
122
+ transform : translateX (-50% );
123
+ padding : 4px 8px ;
124
+ background-color : rgb (0 49 100 / 40% );
125
+ color : var (--primary-color );
126
+ border-radius : 10px ;
127
+ font-size : 12px ;
128
+ white-space : nowrap;
129
+ z-index : 1000 ;
88
130
}
You can’t perform that action at this time.
0 commit comments