diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/state.c | 9 | ||||
-rw-r--r-- | src/world.c | 15 |
2 files changed, 12 insertions, 12 deletions
diff --git a/src/state.c b/src/state.c index 3176fd1..77f6365 100644 --- a/src/state.c +++ b/src/state.c @@ -659,14 +659,13 @@ lilv_state_new_from_string(LilvWorld* world, set_prefixes(env); serd_reader_read_string(reader, USTR(str)); - const SordNode* p = sord_new_uri(world->world, USTR(LILV_NS_RDF "type")); - const SordNode* o = sord_new_uri(world->world, USTR(LV2_PRESETS__Preset)); - SordIter* const i = sord_search(model, NULL, p, o, NULL); - const SordNode* s = sord_iter_get_node(i, SORD_SUBJECT); + SordNode* o = sord_new_uri(world->world, USTR(LV2_PRESETS__Preset)); + SordNode* s = sord_get(model, NULL, world->uris.rdf_a, o, NULL); LilvState* state = new_state_from_model(world, map, model, s, NULL); - sord_iter_free(i); + sord_node_free(world->world, s); + sord_node_free(world->world, o); serd_reader_free(reader); sord_free(model); serd_env_free(env); diff --git a/src/world.c b/src/world.c index 147690b..4262723 100644 --- a/src/world.c +++ b/src/world.c @@ -208,13 +208,14 @@ lilv_world_get(LilvWorld* world, const LilvNode* predicate, const LilvNode* object) { - return lilv_node_new_from_node( - world, - sord_get(world->model, - subject ? subject->node : NULL, - predicate ? predicate->node : NULL, - object ? object->node : NULL, - NULL)); + SordNode* snode = sord_get(world->model, + subject ? subject->node : NULL, + predicate ? predicate->node : NULL, + object ? object->node : NULL, + NULL); + LilvNode* lnode = lilv_node_new_from_node(world, snode); + sord_node_free(world->world, snode); + return lnode; } SordIter* |