Skip to content

RDFPropertyMap refactoring #31

Description

@niniemann

Okay, so there is more than just the problems stated in #30 . Right now I wanted to actually remove one property from a RDFPropertyMap, but only implemented a workaround in b2ee78e because this touches something deep internally: Every map entry stores the index to where the actual RDF triple in the RDFEntity lies. So if I want to remove one entry I'd need to update all the other ones.

I'd like to rework this a bit, and provide an alternative implementation/strategy to the RDFPropertyMap.
The RDFPropertyMap right now is totally dynamic in size as well as in the types of its entries.
A static variant of it would be nice: Maybe fixed in size? But at least with somewhat fixed entries. A templated version of the RDFValueProxy, and maybe without the key but with indices instead, so that one could e.g. use it as

class MyEntity : public Entity {
    using Ptr = std::shared_ptr<MyEntity>;
    RDFTripleArray rdf_;
    RDFValue<int> age_;
    RDFValue<std::string> name_;
    RDFValue<MyEntity::Ptr> someRelation_;

public:
    MyEntity() : age_(rdf_, 0), name_(rdf_, 1), someRelation_(rdf_, 2)
    { }
};

Or the like. Just some idea.

Woops: These are 2 things.

  1. Fix RDFPropertyMap to correctly remove entries.
  2. Implement a more static alternative.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions