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

To string method #233

Closed
conjectwan opened this issue Jan 26, 2015 · 4 comments
Closed

To string method #233

conjectwan opened this issue Jan 26, 2015 · 4 comments

Comments

@conjectwan
Copy link

Hello,

If we need to have a human-readable version of a resource, we pass by the __toString method.

I'm asking myself about the pertinence to return the resource uri. Indeed, the uri is not very human-readable. That would not be preferable to return a rdfs:label if it is defined ?

Thank you in advance.

@njh
Copy link
Collaborator

njh commented Jan 26, 2015

Good point.

There is a ->label() method that does this, and falls back to other properties if no rdfs:label is available.

@conjectwan
Copy link
Author

Thank you for your response. The problem is that today, we use a tierce library that casts an object into a string. So we can not pass by an other function that __toString or profit of the label function in this case.

@k00ni
Copy link
Contributor

k00ni commented Jul 23, 2020

Is there anything to add here? If not, we should close this issue and mark it as "wont-fix".

@njh
Copy link
Collaborator

njh commented Jul 23, 2020

Yeah, I think that __toString() has been returning URIs for so long, that it is likely that people depend upon that behaviour.

@conjectwan sorry, this was a very long time ago, so you have probably moved on, but you could subclass EasyRdf\Resource and then change the default class for resources using EasyRdf\TypeMapper\setDefaultResourceClass().

@njh njh closed this as completed Jul 23, 2020
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