Closed igrangel closed 6 years ago
?oldid
is removed from nsprov:wasDerived
by adding one more condition for excluding the postfix and validating obtained result.
Great. Can you separate this in a method, and call the method in this part? I'm concerned with the complexity of this code and this will the readability as well as the separation of concerns. It is important to think about the maintainability and readability of the code from the very beginning.
1 - Remove the
?oldid
fromnsprov:wasDerived
For example, if you check the following: nsprov:wasDerivedFrom http://en.wikipedia.org/wiki/Fieldbus?oldid=742124333 ; you will obtain the current wikipedia link - http://en.wikipedia.org/wiki/Fieldbus The same occurs with the following: nsprov:wasDerivedFrom http://en.wikipedia.org/wiki/Object_Management_Group?oldid=734349043 http://en.wikipedia.org/wiki/Object_Management_Group.2 - Therefore, after removing the
?oldid
you check if what is still there is a valid URI 3 - If the obtained string is a valid URI include it in the result.