public LiteralRequiredException( RDFNode n ) { super( n.toString() ); }
public UnknownShortnameException( RDFNode res ) { super( reason + res.toString(), "", BAD_REQUEST ); }
private String getTrimmedObject(Statement next1) { String s = next1.getObject().toString().replaceAll("http://spire.umbc.edu/ethan/", ""); s = s.replace("http://spire.umbc.edu/ontologies/SpireEcoConcepts.owl#", ""); return s.replaceAll("\\^\\^http://www.w3.org/2001/XMLSchema#string", ""); }
private static List<String> toString(Set<? extends RDFNode> values) { List<String> strings = CollectionUtil.makeList(); int bNodeCount = 0; for( RDFNode value : values ) { if( value.isAnon() ) bNodeCount++; else strings.add( value.toString() ); } if( bNodeCount > 0 ) { strings.add( bNodeCount + " BNode(s)" ); } return strings; }
private static List<String> toString(Set<? extends RDFNode> values) { List<String> strings = CollectionUtil.makeList(); int bNodeCount = 0; for( RDFNode value : values ) { if( value.isAnon() ) { bNodeCount++; } else { strings.add( value.toString() ); } } if( bNodeCount > 0 ) { strings.add( bNodeCount + " BNode(s)" ); } return strings; }
public String getPicture() { Statement picture = wrapped.getProperty(FOAF.depiction); return picture == null ? null : picture.getObject().toString(); }
private JSONArray getWorksheetHistory(Resource mappingResource) throws JSONException { Property hasTransformation = model.getProperty(Uris.KM_HAS_WORKSHEET_HISTORY_URI); NodeIterator transItr = model.listObjectsOfProperty(mappingResource, hasTransformation); while (transItr.hasNext()) { String commands = transItr.next().toString(); return new JSONArray(commands); } return new JSONArray(); }
/** * Helper method - extracts the truth of a boolean configuration * predicate. * @param predicate the predicate to be tested * @param configuration the configuration node * @return null if there is no setting otherwise a Boolean giving the setting value */ public static Boolean checkBinaryPredicate(Property predicate, Resource configuration) { StmtIterator i = configuration.listProperties(predicate); if (i.hasNext()) { return new Boolean(i.nextStatement().getObject().toString().equalsIgnoreCase("true")); } else { return null; } }
@Override public void consume(ResultSet rs) { while (rs.hasNext()) { QuerySolution qs = rs.next(); result[0] = qs.get(e.outName).toString(); } }
private static Predicate createPredicate(RDFNode node, int arity) { String s = node.toString(); s = URIzer.instance().output(s); return new Predicate(s, arity); }
public String getLabel() { Statement label = wrapped.getProperty(RDFS.label); return label == null ? wrapped.getLocalName() : label.getObject().toString(); }
/** * Answer the string value of the parameter if set, or null otherwise. Note command line * has precedence. * * @return String */ protected String getStringValue( List<String> cmdLineArgs, Resource confRoot ) { RDFNode n = getValue( cmdLineArgs, confRoot ); return (n == null) ? null : (n.isLiteral() ? n.asLiteral().getLexicalForm() : n.toString() ); }
/** * Return the lexical form of a node. This is the lexical form of a * literal, the URI of a URIResource or the annonID of a bNode. */ public static String getLexicalForm(RDFNode value) { if (value.isLiteral()) { return ((Literal)value).getLexicalForm(); } else if (value.isURIResource()) { return ((Resource)value).getURI(); } else { return value.toString(); } }
/** * Return the lexical form of a node. This is the lexical form of a * literal, the URI of a URIResource or the annonID of a bNode. */ public static String getLexicalForm(RDFNode value) { if (value.isLiteral()) { return ((Literal)value).getLexicalForm(); } else if (value.isURIResource()) { return ((Resource)value).getURI(); } else { return value.toString(); } }
public static String getClassLabel(Resource uri){ StmtIterator iter = InternalModelConf.getDAQModel().listStatements(uri, RDFS.label, (RDFNode) null); String label = ""; while (iter.hasNext()){ label = iter.nextStatement().getObject().toString(); } return label; }
public static String getClassDescription(Resource uri){ StmtIterator iter = InternalModelConf.getDAQModel().listStatements(uri, RDFS.comment, (RDFNode) null); String label = ""; while (iter.hasNext()){ label = iter.nextStatement().getObject().toString(); } return label; }
private String asBody( RDFNode n ) { if (n.isLiteral()) return n.asLiteral().getLexicalForm(); if (n.isResource()) return n.asResource().getURI(); return n.toString(); }
/** * Constructor * @param factory the parent reasoner factory which is consulted to answer capability questions * @param configuration RDF information to configure the rule set and mode, can be null */ public RDFSRuleReasoner(ReasonerFactory factory, Resource configuration) { this(factory); if (configuration != null) { StmtIterator i = configuration.listProperties(); while (i.hasNext()) { Statement st = i.nextStatement(); doSetParameter(st.getPredicate(), st.getObject().toString()); } } }
private void createGraphNodeToTriplesNodeMap(KR2RMLMapping kr2rmlMapping) throws FileNotFoundException, UnsupportedEncodingException{ StmtIterator itr = model.listStatements(null, model.getProperty(Uris.KM_NODE_ID_URI), (RDFNode)null); Resource subject; Map<String,String> graphNodeIdToTriplesMapIdMap = kr2rmlMapping.getAuxInfo().getGraphNodeIdToTriplesMapIdMap(); while (itr.hasNext()) { Statement subjMapToNodeIdStmt = itr.next(); String nodeId = subjMapToNodeIdStmt.getObject().toString(); subject = subjMapToNodeIdStmt.getSubject(); if (subject != null) { StmtIterator itr2 = model.listStatements(null, model.getProperty(Uris.RR_SUBJECTMAP_URI), subject); while (itr2.hasNext()) { String triplesMapId = itr2.next().getSubject().toString(); graphNodeIdToTriplesMapIdMap.put(nodeId, triplesMapId); } } } }
private static Term createTerm(RDFNode node) { Term term = null; if (node.isLiteral()) { Literal l = node.asLiteral(); term = DefaultTermFactory.instance().createLiteral(URIUtils.createURI(l.getDatatypeURI()), l.getValue()); } else { term = DefaultTermFactory.instance().createConstant(URIzer.instance().output(node.toString())); } return term; }