Is it possible in DGraph to refer to items from the metamodel just like any other nodes? By that I mean does DGraph support models like this one (written in RDF)?
:Car a owl:Class .
:SkodaCar a owl:Class ;
rdfs:subClassOf Car .
:my-skoda-car a :SkodaCar ;
:boughtAt :my-car-distributor .
:my-car-distributor a :CarDistributor ;
:sellsBrand :SkodaCar .
or
:sellsBrand a rdf:Property .
:mySchema :hasProperty :sellsBrand .
Michel, thanks for the answer. That however is not what I was asking about. My point is: in RDF (or other paradigms like the one in TypeDB), you can refer to elements of the schema (classes, properties), just like you do to instances. In particular, they can be used as an object of possibly any (other) relation. This is what my example is trying to demonstrate. Itās not about OWL, RDFS or formats.
The answer to those questions is no. And this example you have shared is pure OWL.
In theory, you can do whatever other Graph DB can do. But not in the same way and you have to learn DQL pretty well. However, you wonāt have any easy life to mimicate those characteristics.
Thanks! And can you ask DQL queries like āgive me all the outgoing/incoming links from/to the given node?ā I could find expand(_all_) but from what I understood, it only gives you nodes, not edges. Is there a way to also get the edges / edge names?
it is impossible in dql to ask āgive me all fields and edges āonā a nodeā because you have to ask for everything you want to access. Storage is organized by predicate, not by node - so you cannot grab a āwhole nodeā. Using expand() with the type system can help organize and auto-fill those fields, but does not mean some other field could not exist āonā that node that is not within your types. This can be enforced in application code though.
Expand actually does give you edges as well, but only ones defined in the type system.
{q(func: eq(id,"blah")){
id
myfield
myedge {
uid
id
myfield
}
}}
when using expand(_all_) it basically looks up the values of dgraph.type on the nodes in question, and applies every type listed there to expand(). Note expand can be used with specified types without recording those type in dgraph.type