Feature request: Define Methods for Namespace::Class

Bug #88761 reported by Benjamin Heitmann
2
Affects Status Importance Assigned to Milestone
ActiveRDF
Confirmed
Medium
Unassigned

Bug Description

It would be very useful if a method could be defined for a Namespace::Class .

I am not sure if this a feature that should be implemented in ActiveRDF or in SWORD.

One possible usecase:

For a lot of data, not all reverse properties are present.
e.g. sioc::forum - sioc::container_of -> sioc::post,
but almost never sioc::post - sioc::has_container -> sioc::forum

Defining what to do if a property is not found in multiple places in the code is not DRY,
and gets boring after the third time :P

I would like to be able to write the following:

class SIOC::Post < RDFS::Resource
def has_container
   return self.sioc::has_container || (Query.new.select(:s).where(:s, SIOC::container_of, self).execute)[0]
end
end

Revision history for this message
Eyal Oren (ikbeneyal) wrote :

this should work already: since it doesn't, it seems to be a bug

Changed in sword:
importance: Undecided → Medium
status: Unconfirmed → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.