}
}
private void onePattern(Item elt)
{
Item pat = elt.getList().get(0) ;
if (pat.isNode())
{
// (<uri> weight)
Node n = pat.getNode() ;
if (!n.isURI())
{
log.warn("Not a preicate URI: " + pat.toString()) ;
return ;
}
addAbbreviation(elt) ;
}
else if (pat.isSymbol())
{
if ( pat.equals(OTHER) )
{
double d = elt.getList().get(1).getDouble() ;
DefaultMatch = d ;
return ;
}
if ( pat.equals(BNODE) || pat.equals(LITERAL) )
{
log.warn("Not a match for a predicate URI: " + pat.toString()) ;
return ;
}
if ( pat.equals(TERM) || pat.equals(VAR) || pat.equals(ANY) )
addAbbreviation(elt) ;
else
{
log.warn("Not understood: " + pat) ;
return ;
}
}
else if (pat.isList() && pat.getList().size() == 3)
{
// It's of the form ((S P O) weight)
Item w = elt.getList().get(1) ;
Pattern pattern = new Pattern(((Number)(w.getNode().getLiteralValue())).doubleValue(),
intern(pat.getList().get(0)), intern(pat.getList().get(1)),
intern(pat.getList().get(2))) ;
addPattern(pattern) ;
}
else