JanusGraph->Index Backends -> Search Predicates and Data Types
3838 단어 그림 데이터베이스
eq (equal)
neq (not equal)
gt (greater than)
gte (greater than or equal)
lt (less than)
lte (less than or equal)
Text search predicates which match against the individual words inside a text string after it has been tokenized. These predicates are not case sensitive.
textContains: is true if (at least) one word inside the text string matches the query string
textContainsPrefix: is true if (at least) one word inside the text string begins with the query string
textContainsRegex: is true if (at least) one word inside the text string matches the given regular expression
String search predicates which match against the entire string value
textPrefix: if the string value starts with the given query string
textRegex: if the string value matches the given regular expression in its entirety
g.V().has("name", "hercules") // 2) Find all vertices with an age greater than 50 g.V().has("age", gt(50)) // or find all vertices between 1000 (inclusive) and 5000 (exclusive) years of age and order by increasing age g.V().has("age", inside(1000, 5000)).order().by("age", incr) // which returns the same result set as the following query but in reverse order g.V().has("age", inside(1000, 5000)).order().by("age", decr) // 3) Find all edges where the place is at most 50 kilometers from the given latitude-longitude pair g.E().has("place", geoWithin(Geoshape.circle(37.97, 23.72, 50))) // 4) Find all edges where reason contains the word "loves" g.E().has("reason", textContains("loves")) // or all edges which contain two words (need to chunk into individual words) g.E().has("reason", textContains("loves")).has("reason", textContains("breezes")) // or all edges which contain words that start with "lov" g.E().has("reason", textContainsPrefix("lov")) // or all edges which contain words that match the regular expression "br[ez]*s" in their entirety g.E().has("reason", textContainsRegex("br[ez]*s")) // 5) Find all vertices older than a thousand years and named "saturn" g.V().has("age", gt(1000)).has("name", "saturn")
Byte
Short
Integer
Long
Float
Double
Decimal
Precision
String
Geoshape
Date
Instant
//lat, lng
Geoshape.point(37.97, 23.72)
//lat, lng, radius in km
Geoshape.circle(37.97, 23.72, 50)
//SW lat, SW lng, NE lat, NE lng
Geoshape.box(37.97, 23.72, 38.97, 24.72)
//string
"37.97, 23.72"
//list
[37.97, 23.72]
//GeoJSON feature
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [125.6, 10.1]
},
"properties": {
"name": "Dinagat Islands"
}
}
//GeoJSON geometry
{
"type": "Point",
"coordinates": [125.6, 10.1]
}
mgmt = graph.openManagement()
nameProperty = mgmt.makePropertyKey("names").dataType(String.class).cardinality(Cardinality.SET).make()
mgmt.buildIndex("search", Vertex.class).addKey(nameProperty, Mapping.STRING.asParameter()).buildMixedIndex("search")
mgmt.commit()
//Insert a vertex
person = graph.addVertex()
person.property("names", "Robert")
person.property("names", "Bob")
graph.tx().commit()
//Now query it
g.V().has("names", "Bob").count().next() //1
g.V().has("names", "Robert").count().next() //1
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
JanusGraph 대량 가져오기 데이터 코드 요약여기에 사용자 정의 디렉터리 제목을 쓰십시오 설명 1. Json로컬 TinkerGraph 로 가져오기 1.1 구성 1.2 예제 Json 1.3 코드 1.4 파일 체크 2. CSV를 로컬 TinkerGraph 로 가져...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.