Example #1
0
        def store_node_mappings(_session, _uri, _definition):
            _storage = convert_rdf_json_to_storage(_definition, store_properties=False, store_types=False,
                                                   bnode_mappings=_session)
            _storage.about = _session[_uri]
            _promise = self._storage_client.update_node(_storage)

            return _promise.then(lambda s: _session)
Example #2
0
        def store_and_update_session(_session, _uri, _definition):
            """
            Store the initial data sets (all of the properties and references that are not bnodes).
            :param _session:
            :param _uri:
            :param _definition:
            :return:
            """
            _storage = convert_rdf_json_to_storage(_definition, store_bnodes=False)

            # Add the reference to this bot to mark it as the creator.
            _storage.add_reference(DCTERMS.creator, self._representation_manager.representation_uri)

            _promise = self._storage_client.create_node(_storage)
            return _promise.then(g_p_h(store_result, _session, _uri))