[doc] fix abstract and example of data import
authorNicolas Chauvat <nicolas.chauvat@logilab.fr>
Mon, 02 May 2016 17:14:43 +0200
changeset 11239 19cacea03fde
parent 11238 bb5fdf1eb8fb
child 11240 1694e6e9ff94
[doc] fix abstract and example of data import
doc/book/devrepo/dataimport.rst
--- a/doc/book/devrepo/dataimport.rst	Sun May 01 22:00:14 2016 +0200
+++ b/doc/book/devrepo/dataimport.rst	Mon May 02 17:14:43 2016 +0200
@@ -55,15 +55,15 @@
         """Yield Person ExtEntities read from `fpath` CSV file."""
         with open(fpath) as f:
             for uri, name, knows in ucsvreader(f, skipfirst=True, skip_empty=False):
-                yield ExtEntity('Personne', uri,
-                                {'nom': set([name]), 'connait': set([knows])})
+                yield ExtEntity('Person', uri,
+                                {'name': set([name]), 'knows': set([knows])})
 
     extenties = extentities_from_csv('people.csv')
     store = RQLObjectStore(cnx)
     importer = ExtEntitiesImporter(schema, store)
     importer.import_entities(extenties)
     commit()
-    rset = cnx.execute('String N WHERE X nom N, X connait Y, Y nom "Alice"')
+    rset = cnx.execute('String N WHERE X name N, X knows Y, Y name "Alice"')
     assert rset[0][0] == u'Bob', rset
 
 Importer API