Smalyshev has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/188130

Change subject: Change schema to make badges indexable
......................................................................

Change schema to make badges indexable

Query by badges as: g.query().has('badge','gold').properties()*.element()
See also:
https://groups.google.com/forum/#!topic/aureliusgraphs/277G0avVTQA

Change-Id: I43ec4d8174c1fca60a2d1fd04b994aca5251cb79
---
M src/main/groovy/org/wikidata/gremlin/Schema.groovy
1 file changed, 4 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikidata/gremlin 
refs/changes/30/188130/1

diff --git a/src/main/groovy/org/wikidata/gremlin/Schema.groovy 
b/src/main/groovy/org/wikidata/gremlin/Schema.groovy
index f42fca2..e5ac0d8 100644
--- a/src/main/groovy/org/wikidata/gremlin/Schema.groovy
+++ b/src/main/groovy/org/wikidata/gremlin/Schema.groovy
@@ -22,6 +22,8 @@
 import com.tinkerpop.gremlin.process.T
 import com.thinkaurelius.titan.core.Cardinality
 
+import com.thinkaurelius.titan.core.TitanVertexProperty
+
 import groovy.util.logging.Slf4j
 
 /**
@@ -84,7 +86,7 @@
     //addIndex(mgmt, 'by_hash', Vertex.class, [hash]) //? may not be needed
     addIndex(mgmt, 'by_Ehash', Edge.class, [hash])
     // vertices by badges
-    addIndex(mgmt, 'by_badge', Vertex.class, [badge])
+    addIndex(mgmt, 'by_badge', TitanVertexProperty.class, [badge])
 
     // Vertex-centric indexes
     addVIndex(mgmt, claims, 'by_claimsHash', hash)
@@ -98,7 +100,7 @@
     addMixedIndex(mgmt, "by_values", Edge.class, [prop])
     // Index for sitelinks
     addMixedIndex(mgmt, "by_sitelinks", Vertex.class, [])
-    addMixedIndex(mgmt, "by_badges_", Vertex.class, [badgeE])
+    addMixedIndex(mgmt, "by_badges_", TitanVertexProperty.class, [badgeE])
     // addMixedIndex(mgmt, "by_sitelinksE", Edge.class, [etype, badge, prop, 
wikibaseId])
 
     mgmt.commit()

-- 
To view, visit https://gerrit.wikimedia.org/r/188130
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I43ec4d8174c1fca60a2d1fd04b994aca5251cb79
Gerrit-PatchSet: 1
Gerrit-Project: wikidata/gremlin
Gerrit-Branch: master
Gerrit-Owner: Smalyshev <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to