Hi Arne,

thanks so much, I checked I had created the dataset into the default graph.

As soon as I created the named graph, as you recommended I got the expected
results.

Best regards


Luis

El mié, 8 may 2024 a las 23:30, Arne Bernhardt (<arne.bernha...@gmail.com>)
escribió:

> Hi Louis,
>
> You might have uploaded the MeSH ontology into the default graph or at
> least not into a graph with the name `<http://id.nlm.nih.gov/mesh>`.
>
> From the query editor at https://id.nlm.nih.gov/mesh/query, I see that
> they
> have different graphs for each year (current = `<
> http://id.nlm.nih.gov/mesh>`,
> 2024 = `<http://id.nlm.nih.gov/mesh/2024>`, and 2023 = `<
> http://id.nlm.nih.gov/mesh/2023>`). To use the sample queries, you need to
> upload the data into the dataset using the corresponding names.
>
> Fixing the query is not an option if different years have all been uploaded
> into the same default graph. A glimpse into the data told me that all
> subjects begin with `http://id.nlm.nih.gov/mesh/`
> <http://id.nlm.nih.gov/mesh/>. So, you could filter for
> a specific year like this: `FILTER(STRSTARTS(STR(?subject), "
> http://id.nlm.nih.gov/mesh/2024";))`. Unfortunately, this does not work for
> the current year, as in your example, since
> `FILTER(STRSTARTS(STR(?subject), "http://id.nlm.nih.gov/mesh/";))` would
> include all subsequent years.
>
> To check your assumption about the default graph and where your data is: In
> the Fuseki UI, there is the "info" tab for your dataset, where you may
> click "count triples in all graphs," which gives you a list of all graphs
> in your dataset, their names, and the corresponding triple count. The
> following query should provide the same information:
>
> ```
> SELECT ?graph_name (COUNT(?s) AS ?triples)
> WHERE {
>   {
>     BIND('default graph' AS ?graph_name)
>     OPTIONAL { ?s ?p ?o. }
>   }
>   UNION
>   {
>     GRAPH ?graph_name { OPTIONAL { ?s ?p ?o. } }
>   }
> }
> GROUP BY ?graph_name
> ```
>
> See also
>
> https://jena.apache.org/tutorials/sparql_datasets.html#describing-rdf-datasets---from-and-from-named
> .
>
> I hope this helps.
>
> Arne
>
> Am Mi., 8. Mai 2024 um 19:23 Uhr schrieb Luis Enrique Ramos García
> <luisenriqueramos1...@googlemail.com.invalid>:
>
> > I uploaded the mesh ontology in fuseki,
> > but when I try with the query the sample queries recommended in their
> > documentation:
> > https://hhs.github.io/meshrdf/sample-queries
> >
> > I get no results.
> >
> > For instance:
> > PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
> > PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
> > PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
> > PREFIX owl: <http://www.w3.org/2002/07/owl#>
> > PREFIX meshv: <http://id.nlm.nih.gov/mesh/vocab#>
> > PREFIX mesh: <http://id.nlm.nih.gov/mesh/>
> > PREFIX mesh2015: <http://id.nlm.nih.gov/mesh/2015/>
> > PREFIX mesh2016: <http://id.nlm.nih.gov/mesh/2016/>
> > PREFIX mesh2017: <http://id.nlm.nih.gov/mesh/2017/>
> > SELECT DISTINCT ?p
> > FROM <http://id.nlm.nih.gov/mesh>
> > WHERE {
> > ?s ?p ?o
> > }
> > ORDER BY ?p
> >
> > It gives me no results, but when I comment out the line with the FROM
> > clause, I get some results.
> >
> > I assume the data with namespace meshv is in the default graph, and the
> > other data is in a specific named graph, but I am not sure how I have to
> > write the query to get the data in the named graphs.
> >
> > Thanks in advanced
> >
> >
> > Luis Ramos
> >
>

Reply via email to