--- 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