/** * METHOD TO DO * * @param resultSet PARAMETER TO DO * @return RETURNED VALUE TO DO * @throws SQLException EXCEPTION TO DO */ private Variable[] resultSetToVariables(ResultSet resultSet) throws SQLException { ResultSetMetaData rsmd = resultSet.getMetaData(); Variable[] variables = new Variable[rsmd.getColumnCount()]; for (int i = 0; i < rsmd.getColumnCount(); i++) { variables[i] = new Variable(rsmd.getColumnName(i + 1)); } return variables; } }
public LiteralTuples(String[] variableNames, boolean sorted) { List vars = new ArrayList(); for (int i = 0; i < variableNames.length; i++) { Variable v = new Variable(variableNames[i]); assert!vars.contains(v); vars.add(v); } init((Variable[]) vars.toArray(new Variable[0]), sorted); }
/** * Gets the internal column number for a column with the given name * @param name The name of the column to search for. * @return The column number for the column with the given name. */ public int getInternalColumnIndex(String name) { try { return tuples.getColumnIndex(new Variable(name)); } catch (Exception te) { // TuplesException return NOT_BOUND; } }
/** * Gets the variables name of the answer object - starting at 0. * * @param column the column number columns start at 0. * @return the {@link Variable}s bound within this answer. * @throws TuplesException if there was an error accessing the variable. */ public Variable getVariable(int column) throws TuplesException { try { return new Variable(resultSet.getMetaData().getColumnName(column + 1)); } catch (SQLException e) { throw new TuplesException("Couldn't get variable for column " + (column + 1), e); } }
public Object getObject(String columnName) throws TuplesException { return getObject(getColumnIndex(new Variable(columnName))); }
public Object getObject(String columnName) throws TuplesException { return getObject(getColumnIndex(new Variable(columnName))); }
Variable modelTypeVariable = new Variable("modelType"); Constraint modelConstraint = new ConstraintImpl(new LocalNode(model),
new LocalNode(graph), new LocalNode(metadata.getRdfTypeNode()), new Variable("x"), new LocalNode(metadata.getSystemModelNode())));
Variable modelTypeVariable = new Variable("modelType"); Resolution resolution = systemResolver.resolve( new ConstraintImpl(new LocalNode(model),