Hi,
How to fetch the all property name of the node, line in gramline
g.V().hasLabel("ABC").valueMaps()
Hi,
How to fetch the all property name of the node, line in gramline
g.V().hasLabel("ABC").valueMaps()
{
all(func: allofterms(name, "ABC")) {
_predicate_
}
}
Result obtained:
{
"_predicate_": [
"name",
"age",
"friend",
"owns_pet"
]
}
Let me know if this works for you.
I tried
{
all(func: allofterms(name, "Movie")) {
_predicate_
}
}
and i am getting error
‘: Attribute name is not indexed with type term’
hi, @karan28aug
I tried
{
all(func: allofterms(name, "Movie")) {
_predicate_
}
}
and i am getting error
‘: Attribute name is not indexed with type term’
This may be because name is not the predicate for the movie in your data.
I used this data:
{
set {
_:michael <name> "Michael" .
_:michael <age> "39" .
_:michael <friend> _:amit .
_:michael <friend> _:sarah .
_:michael <friend> _:sang .
_:michael <friend> _:catalina .
_:michael <friend> _:artyom .
_:michael <owns_pet> _:rammy .
_:amit <name> "अमित"@hi .
_:amit <name> "অমিত"@bn .
_:amit <name> "Amit"@en .
_:amit <age> "35" .
_:amit <friend> _:michael .
_:amit <friend> _:sang .
_:amit <friend> _:artyom .
_:luke <name> "Luke"@en .
_:luke <name> "Łukasz"@pl .
_:luke <age> "77" .
_:artyom <name> "Артём"@ru .
_:artyom <name> "Artyom"@en .
_:artyom <age> "35" .
_:sarah <name> "Sarah" .
_:sarah <age> "55" .
_:sang <name> "상현"@ko .
_:sang <name> "Sang Hyun"@en .
_:sang <age> "24" .
_:sang <friend> _:amit .
_:sang <friend> _:catalina .
_:sang <friend> _:hyung .
_:sang <owns_pet> _:goldie .
_:hyung <name> "형신"@ko .
_:hyung <name> "Hyung Sin"@en .
_:hyung <friend> _:sang .
_:catalina <name> "Catalina" .
_:catalina <age> "19" .
_:catalina <friend> _:sang .
_:catalina <owns_pet> _:perro .
_:rammy <name> "Rammy the sheep" .
_:goldie <name> "Goldie" .
_:perro <name> "Perro" .
}
}
Schema:
name: string @index(term) @lang .
age: int @index(int) .
friend: uid @count .
Query:
{
all(func: allofterms(name, "Michael")) {
_predicate_
}
}
Result:
{
"data": {
"all": [
{
"_predicate_": [
"name",
"age",
"friend",
"owns_pet"
]
}
]
},
But when I am using this query:
{
all(func: allofterms(age, "Michael")) {
_predicate_
}
}
Result: Attribute age is not indexed with type term
I hope this example clears your doubt.