well, there is some <Class> with <Name> "Teacher":

|BASE    <http://www.w3.org/TR/html4/>||
||PREFIX  : <http://acandonorway.github.com/XmlToRdf/ontology.ttl#>||
||
||SELECT  ?o||
||WHERE||
||  { ?x  <Name>  "Teacher" ;||
||        a       <Class> .||
||    ?x (:hasChild/:hasChild)/<Name> ?o||
||  }|


it does return

|-------------||
||| o         |||
||=============||
||| "Emri"    |||
||| "Lendet"  |||
||| "Mbiemri" |||
||| "Id"      |||
||-------------|

But I don't see how the other two things ('Evaluations', 'User') would be related to the class ...

By the way, also asked and answered at SO: https://stackoverflow.com/questions/67298506/sparql-query-on-a-specific-rdf-format

On 27.04.21 17:49, Andy Seaborne wrote:


On 27/04/2021 14:11, emri mbiemri wrote:
The "Teacher" node is within a <class> node and the "Teacher" class contains the <attribute> node but I don't know how to get all these attributes due to the complex model format.

There is no <class>

There is

<Class2>Teacher</Class2>

but it is a property <Class2> and a string "Teacher"

As I suggested:

riot --pretty Turtle Notebook.rdf

    Andy


On 2021/04/27 13:00:38, Andy Seaborne <a...@apache.org> wrote:
There isn't a class Teacher in the file - there is a string "Teacher" in
a couple of places.

Try writing the file out in a format that is easier to look at:

Command line:

riot --pretty Turtle Notebook.rdf

To query for all classes:

sparql --data ~/Desktop/Notebook.rdf 'SELECT DISTINCT ?T { ?x a ?T }'

      Andy

On 27/04/2021 11:55, emri mbiemri wrote:
Dears,

I am trying to query a specific RDF file.  I  need this solution for my studies.

The file I have to work with is:
https://github.com/iliriani/Test/blob/main/Notebook.rdf

I am trying to get somehow all the attributes of a given class within this model. But cannot find the right query!

For instance, I want to get all attributes of class "Teacher", it should return me:
- id
- Emri
- Mbiemri
- Lendet
- Evaluations
- User


Reply via email to