Get all nodes with uid

Hi,

I have a database which consists of triples like and the uid is assign dynamically.

I added some more triples (mutation).
Is it possible to get all the subject and objects (nodes) along with uids using a query?

Update 1: I got all the nodes and uid.
Let say,

“aman” has a uid = 0x11

Now I want to add one more triple for uid - 0x11

I did

_:object <name@en> "Carom".
 _:0x11 <likes_for> _:object

.

Every time I run a different uid is been created.

for uid in assigned.uids:
     print('{} => {}'.format(uid, assigned.uids[uid]))
0x11 => 0xf9087
object => 0xf9088
0x11 => 0xf9089
object => 0xf9088

Thanks.

This usage is wrong, you are setting a “Blank_Node”. The correct syntax for existing Nodes is
<0x11> <likes_for> _:object

Just like you defined a user “” aman “has a uid = 0x11” you have to already define a single Node that represents “Carom”. And then use your UID.

_:object <name@en> "Carom" .  ==> has uid 0x112
_:object2 <name@en> "Other" .  ==> has uid 0xf54
_:object3 <name@en> "Other" .  ==> has uid 0xf18

Now:

<0x11> <likes_for> <0x112> .

Cheers.

1 Like