Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RDFPropertyMap refactoring #31

Open
niniemann opened this issue Jun 6, 2018 · 0 comments
Open

RDFPropertyMap refactoring #31

niniemann opened this issue Jun 6, 2018 · 0 comments
Assignees

Comments

@niniemann
Copy link
Collaborator

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant