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

Add namespaces to MgdSchema types #105

Open
bergie opened this issue Jul 1, 2011 · 4 comments
Open

Add namespaces to MgdSchema types #105

bergie opened this issue Jul 1, 2011 · 4 comments
Labels

Comments

@bergie
Copy link
Member

bergie commented Jul 1, 2011

Now all MgdSchema types reside in the Midgard root namespace, so my_article becomes a my_article class in PHP, or midgard.mgdschema.my_article in Python. But we could support namespaced types, and that would also fit JCR compatibility better.

So:

<Schema xmlns:my="http://example.net/myschema/">
    <type name="my:article">

Would map as \my\article in PHP, and midgard.mgdschema.my.article in Python. JCR mapping would obviously be my:article.

@bergie
Copy link
Member Author

bergie commented Jul 1, 2011

In JCR world also properties have namespaces, but this maps a bit badly to most languages, so probably we could do something like:

<property name="my:foo">

Which would map to $object->my_foo in PHP, etc. Again, makes RDF compatibility easier.

@bergie
Copy link
Member Author

bergie commented Jul 1, 2011

Also note that namespaces used should have a valid xmlns definition in the file (the URI there doesn't need to point anywhere real, though). If they're not there, Midgard should throw an error.

On some API level Midgard should then understand that my:foo and http://example.net/myschema/foo are the same.

@piotras
Copy link
Member

piotras commented Jul 1, 2011

Property read and write is not that trivial due to GObject limitations. We already discussed it. Proposed MidgardCR API resolve this problem: http://www.midgard-project.org/api-docs/midgard/core/unstable/midgard3/MidgardCR/MidgardCR.RepositoryObject.html.

@bergie
Copy link
Member Author

bergie commented Jul 1, 2011

Oh, and since MgdSchemas have a default namespace, Midgard should also know that midgard_attachment and http://www.midgard-project.org/repligard/1.4/midgard_attachment are the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants