Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I believe there is some misunderstanding here concerning RDF and XML. RDF is a bunch of triples that can be expressed both in XML and in other serialization formats. Unlike XML, RDF is not hierarchical, therefore <strong>there is no such a thing as "subelement" in RDF</strong>. The fact that Mr. Guid is just is under Mr Node_1 is an illusion "suggested" by the misleading XML node hierarchy. To demonstrate that, I list the triples of your examples (please, mind that the order of triples in RDF is irrelevant!):</p> <p>"Node 1" typeOf Person<br> "Node 1" depiction "Default.png"<br> "Node 1" description "Description"<br> "Node 1" knows "Mr. Guid"<br> "Mr. Guid" typeOf Person<br> "Node 2" typeOf Person<br> "Node 2" depiction "Default.png"<br> "Node 2" description "Description" </p> <p>Try the following: Add one more triple: "Mr. Guid" knows "Node 1" with the following code:</p> <pre><code>Person mrGuid = _rdfDocument.GetIndividual("6779ac10-210b-40d2-8111-711db6988bb9") as Person; Person mrNode1 = _rdfDocument.GetIndividual("Node 1") as Person; mrGuid.knows = mrNode1; Console.WriteLine(_rdfDocument.ToRdfXml()); </code></pre> <p>Now, both Node 1 knows Mr Guid and Mr Guid knows Node 1, and this is a perfectly legal scenario. Who would be the root and who would be the subelement? The XML serializer will probably pick the first one in row to be the "root" and the other as the "subelement", but it is arbitrary. The nesting is just an illusion created by the XML serialization. Do not fall for that.</p> <p>The query you fire with the <code>rdfDocument.GetIndividuals(Person.Uri, true);</code> statement simply filters out all individuals that is of type <code>Person</code>, and hence it returns correctly all the three guys.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload