static boolean startsWithDistinct(ItemList x) { if ( x.size() > 0 && x.car().isSymbol(Tags.tagDistinct) ) return true ; return false ; }
public boolean isTagged() { if ( ! isTaggable() ) return false ; return list.get(0).isSymbol() ; } private boolean isTaggable()
static boolean startsWithDistinct(ItemList x) { if ( x.size() > 0 && x.car().isSymbol(Tags.tagDistinct) ) return true ; return false ; }
public boolean sameSymbol(Item item) { if ( item.isSymbol() ) return sameSymbol(item.getSymbol()) ; return false ; }
public boolean isTagged() { if ( ! isTaggable() ) return false ; return list.get(0).isSymbol() ; } private boolean isTaggable()
public static String buildSymbol(Item item) { if ( !item.isSymbol() ) BuilderLib.broken(item, "Not a symbol", item) ; return item.getSymbol() ; }
public boolean isTagged(String tag) { if ( ! isTaggable() ) return false ; return getList().get(0).isSymbol(tag) ; } public boolean isTagged()
public static ItemList skipTag(ItemList list, String tag) { if ( list.size() > 0 ) { if ( list.get(0).isSymbol(tag) ) list = list.cdr() ; } return list ; } }
public long asInteger() { if ( isNode() ) { if ( getNode().isLiteral() ) // Ignore typing. return Integer.parseInt(getNode().getLiteralLexicalForm()) ; } if ( isSymbol() ) return Integer.parseInt(getSymbol()) ; throw new ItemException("Not a literal or string: "+this) ; }
private static String parseSymbol(Reader reader, PrefixMapping pmap) { Item item = parseTerm(reader, pmap) ; if ( ! item.isSymbol() ) throw new SSEParseException("Not a symbol: "+item, item.getLine(), item.getColumn()) ; return item.getSymbol() ; }
private static String parseSymbol(Reader reader, PrefixMapping pmap) { Item item = parseTerm(reader, pmap) ; if ( ! item.isSymbol() ) throw new SSEParseException("Not a symbol: "+item, item.getLine(), item.getColumn()) ; return item.getSymbol() ; }
public String shortString() { if ( isSymbol() ) return getSymbol(); if ( isNode() ) return FmtUtils.stringForNode(getNode()); return getList().shortString() ; } }
public String shortString() { if ( _size() == 0 ) return "()" ; if ( get(0).isSymbol() ) { if ( _size() == 1 ) return "("+get(0).getSymbol()+")"; else return "("+get(0).getSymbol()+" ...)"; } return "(...)" ; }
public static Triple buildTriple(ItemList list) { if ( list.size() != 3 && list.size() != 4 ) BuilderLib.broken(list, "Not a triple", list) ; if ( list.size() == 4 ) { if ( ! list.get(0).isSymbol(Tags.tagTriple) ) BuilderLib.broken(list, "Not a triple") ; list = list.cdr() ; } return _buildNode3(list) ; }
public static Triple buildTriple(ItemList list) { if ( list.size() != 3 && list.size() != 4 ) BuilderLib.broken(list, "Not a triple", list) ; if ( list.size() == 4 ) { if ( ! list.get(0).isSymbol(Tags.tagTriple) ) BuilderLib.broken(list, "Not a triple") ; list = list.cdr() ; } return _buildNode3(list) ; }
private Path build(Item item) { if (item.isNode() ) { if ( item.getNode().isURI() ) return new P_Link(item.getNode()) ; BuilderLib.broken(item, "Attempt to build path from a plain node") ; } if (item.isSymbol() ) BuilderLib.broken(item, "Attempt to build path from a bare symbol") ; return build(item.getList()) ; }