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

Sync RDF::Trine::NamespaceMap and URI::NamespaceMap #90

Open
kasei opened this issue Aug 31, 2013 · 6 comments
Open

Sync RDF::Trine::NamespaceMap and URI::NamespaceMap #90

kasei opened this issue Aug 31, 2013 · 6 comments
Assignees

Comments

@kasei
Copy link
Owner

kasei commented Aug 31, 2013

As soon as URI::NamespaceMap is feature-compatible, RDF::Trine::NamespaceMap should be made an empty subclass of it, with appropriate deprecation warnings in the rest of the code to using the subclass instead of the superclass.

@kjetilk
Copy link
Contributor

kjetilk commented May 20, 2014

It should be possible to do this now, I think I have fixed the issue we talked about in release 0.10.

@kasei
Copy link
Owner Author

kasei commented May 20, 2014

Thanks. I'll look at updating RDF::Trine.

@kasei
Copy link
Owner Author

kasei commented May 20, 2014

I still don't feel like I'm 100% swapped in on this, but it seems like it might not be as easy as we thought. It doesn't seem to be a drop-in replacement because RDF::Trine code is expecting RDF::Trine::Node::Resource objects back from the namespace expansion, but are instead getting URI objects. I'm not sure where exactly that's happening yet.

@kjetilk
Copy link
Contributor

kjetilk commented May 21, 2014

Right, there has to be some compatibility layer that blesses into Resource objects. Perhaps that's something toby can do with Types::URI.

@tobyink
Copy link

tobyink commented May 21, 2014

I don't think so - type constraints are for coercing and validating incoming data. Here we're wanting to change the class of outgoing data. Currently URI::Namespace is doing something like this:

return URI->new($self->_uri . "$name");

It could instead do something like:

return $self->_uri_class->new($self->_uri . "$name");

Then Trine could subclass URI::Namespace to make sure that $self->_uri_class returned "RDF::Trine::Node::Resource" instead of "URI". And would also need to subclass URI::NamespaceMap to ensure that it used the URI::Namespace subclass instead of URI::Namespace directly.

This would probably require some rethinking the URI::Namespace/URI::NamespaceMap classes first.

@kjetilk
Copy link
Contributor

kjetilk commented Jan 3, 2017

I just had a quick look at this, and figured it probably didn't make much sense to do a lot for Trine.

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

No branches or pull requests

3 participants