« Jython in Eclipse: Red Robin | Main | Isolates! »

Jena SimpleSelector: hmm, oops, ah, ugh

From the Jena Tutorial on sourceforge:

This selector will select all statements with a subject that matches subject, a predicate that matches predicate and an object that matches object. If a nullis supplied in any of the positions, it matches anything; otherwise they match corresponding equal resources or literals. (Two resources are equal if they have equal URIs or are the same blank node; two literals are the same if all their components are equal.) Thus:
            Selector selector 
               = new SimpleSelector(null, null, null);
will select all the statements in a Model.

Hmm.

    JenaReaderTest.java:124: reference to SimpleSelector is ambiguous, both method 
    SimpleSelector(com.hp.hpl.jena.rdf.model.Resource,com.hp.hpl.jena.rdf.model.Property,
    com.hp.hpl.jena.rdf.model.RDFNode) in com.hp.hpl.jena.rdf.model.SimpleSelector and method 
    SimpleSelector(com.hp.hpl.jena.rdf.model.Resource,com.hp.hpl.jena.rdf.model.Property,
    java.lang.String) in com.hp.hpl.jena.rdf.model.SimpleSelector match
          Selector selector = new SimpleSelector(null, null, null);
                              ^
    1 error
    BUILD FAILED
    E:\home\propylon\200.200.200.11\svn\iams\trunk\events\build.xml:114: 
    Compile failed; see the compiler error output for details.

Oops.

Ah.

   Selector selector = new SimpleSelector(null, null, (RDFNode)null);

Ugh.

Javaspaces, bitte...


August 26, 2004 02:43 PM

Comments

RLCA
(August 28, 2004 01:12 PM #)

Ugh is right! However, Javaspaces isn't the solution to bad API design. If anything, people would mis-use it to provide even worse APIs.

Whoever designed the "SimpleSelector" (ironic name or what?) API above should be slowly passed feet-first through a blender, while being read chapter 1 of "OO for dummies".

Trackback Pings

TrackBack URL for this entry:
http://www.dehora.net/mt/mt-tb.cgi/1402