cayleygraph / cayley

An open-source graph database
https://cayley.io
Apache License 2.0
14.86k stars 1.25k forks source link

How cayley query the data belong to blank node #509

Open lnshi opened 7 years ago

lnshi commented 7 years ago

@dennwc @tamethecomplex thanks very much.

After I read up the

and other materials, i designed and played with the following n-quads data:

</users/23TplPdS> <userId> "23TplPdS" .
</users/23TplPdS> <userSetId> "XXXX" .
</users/23TplPdS> <realName> "XXX" .
</users/23TplPdS> <displayName> "lnshi" .
</users/23TplPdS> <gender> "M" .
</users/23TplPdS> <email> "leonard.shi@xx.xx.xx" .
</users/23TplPdS> <isEmailVerified> "false" .
</users/23TplPdS> <mobilePhone> _:l8 .
_:l8 <isVerified> "false" .
_:l8 <alpha3CountryCode> "+65" .
_:l8 <mobilePhoneNoWithCountryCallingCode> "+658672xxxx" .

</users/46Juzcyx> <userId> "46Juzcyx" .
</users/46Juzcyx> <userSetId> "xx.xx.xx_0000" .
</users/46Juzcyx> <realName> "XXXX" .
</users/46Juzcyx> <displayName> "Leonard Shi 0000" .
</users/46Juzcyx> <gender> "M" .
</users/46Juzcyx> <email> "leonard.shi+0000@xx.xx.xx" .
</users/46Juzcyx> <isEmailVerified> "false" .
</users/46Juzcyx> <mobilePhone> _:l20 .
_:l20 <isVerified> "false" .
_:l20 <alpha3CountryCode> "+65" .
_:l20 <mobilePhoneNoWithCountryCallingCode> "+6586720000" .

</users/hwX6aOr7> <userId> "hwX6aOr7" .
</users/hwX6aOr7> <userSetId> "LEONARD__SHI_0001" .
</users/hwX6aOr7> <realName> "LEONARD SHI" .
</users/hwX6aOr7> <displayName> "Leonard Shi 0001" .
</users/hwX6aOr7> <gender> "M" .
</users/hwX6aOr7> <email> "leonard.shi+0001@xx.xx.xx" .
</users/hwX6aOr7> <isEmailVerified> "false" .
</users/hwX6aOr7> <mobilePhone> _:l32 .
_:l32 <isVerified> "false" .
_:l32 <alpha3CountryCode> "+65" .
_:l32 <mobilePhoneNoWithCountryCallingCode> "+6586720001" .

</users/46Juzcyx> <follows> </users/23TplPdS> .
</users/hwX6aOr7> <follows> </users/23TplPdS> .

but with Gremlin query g.V("</users/23TplPdS>").Out().All(), i get the following data:

{
 "result": [
  {
   "id": "23TplPdS"
  },
  {
   "id": "M"
  },
  {
   "id": "XXX"
  },
  {
   "id": "false"
  },
  {
   "id": "_:l8"
  },
  {
   "id": "Leonard Shi"
  },
  {
   "id": "XXXX"
  },
  {
   "id": "leonard.shi@xx.xx.xx"
  }
 ]
}

the data belong to blank node _:l8 are all gone from the result.

So how can I query the data which belong to blank node, or I design the model wrongly?

dennwc commented 7 years ago

This is the problem of current Cayley design that we want to change as a part of #510. You cen get actual data if you try to follow g.V("_:18").Out().All(), but this means everyone need to write the library to follow such links. Thus, we will provide this functionality.

lnshi commented 7 years ago

@dennwc ok, got it, thank you very much.

should we keep this open, or just keep the #510 open and close this one?

dennwc commented 7 years ago

Let's leave it open for now. #510 will cover the transition to new design and this one will track additional functionality for blank nodes.