@Test public void testCreateTriples() { BaseProvenanceModel model = new BaseProvenanceModel(); List<Statement> statements = model.getStatementsForQuery("SELECT ?query where { ?query rdf:type <rya:query>. }", "fakeuser", "SPARQL"); assertTrue(!statements.isEmpty()); }
public List<Statement> getStatementsForQuery(String query, String user, String queryType) { List<Statement> statements = new ArrayList<Statement>(); Resource queryEventResource = VF.createIRI(QUERY_NAMESPACE + UUID.randomUUID().toString()); Statement queryEventDecl = VF.createStatement(queryEventResource, RDF.TYPE, QUERY_EVENT_TYPE); statements.add(queryEventDecl); Statement queryEventTime = VF.createStatement(queryEventResource, AT_TIME_PROPERTY, VF.createLiteral(new Date())); statements.add(queryEventTime); Statement queryUser = VF.createStatement(queryEventResource, ASSOCIATED_WITH_USER, VF.createLiteral(user)); statements.add(queryUser); Statement executedQuery = VF.createStatement(queryEventResource, EXECUTED_QUERY_PROPERTY, VF.createLiteral(query)); statements.add(executedQuery); Statement queryTypeStatement = VF.createStatement(queryEventResource, QUERY_TYPE_PROP, VF.createLiteral(queryType)); statements.add(queryTypeStatement); return statements; }
BaseProvenanceModel implements RDFProvenanceModel { public List<Statement> getStatementsForQuery(String query, String user, String queryType) { List<Statement> statements = new ArrayList<Statement>(); Resource queryEventResource = VF.createIRI(QUERY_NAMESPACE + UUID.randomUUID().toString()); Statement queryEventDecl = VF.createStatement(queryEventResource, RDF.TYPE, QUERY_EVENT_TYPE); statements.add(queryEventDecl); Statement queryEventTime = VF.createStatement(queryEventResource, AT_TIME_PROPERTY, VF.createLiteral(new Date())); statements.add(queryEventTime); Statement queryUser = VF.createStatement(queryEventResource, ASSOCIATED_WITH_USER, VF.createLiteral(user)); statements.add(queryUser); Statement executedQuery = VF.createStatement(queryEventResource, EXECUTED_QUERY_PROPERTY, VF.createLiteral(query)); statements.add(executedQuery); Statement queryTypeStatement = VF.createStatement(queryEventResource, QUERY_TYPE_PROP, VF.createLiteral(queryType)); statements.add(queryTypeStatement); return statements; } }
BaseProvenanceModel implements RDFProvenanceModel { public List<Statement> getStatementsForQuery(String query, String user, String queryType) { List<Statement> statements = new ArrayList<Statement>(); Resource queryEventResource = VF.createIRI(QUERY_NAMESPACE + UUID.randomUUID().toString()); Statement queryEventDecl = VF.createStatement(queryEventResource, RDF.TYPE, QUERY_EVENT_TYPE); statements.add(queryEventDecl); Statement queryEventTime = VF.createStatement(queryEventResource, AT_TIME_PROPERTY, VF.createLiteral(new Date())); statements.add(queryEventTime); Statement queryUser = VF.createStatement(queryEventResource, ASSOCIATED_WITH_USER, VF.createLiteral(user)); statements.add(queryUser); Statement executedQuery = VF.createStatement(queryEventResource, EXECUTED_QUERY_PROPERTY, VF.createLiteral(query)); statements.add(executedQuery); Statement queryTypeStatement = VF.createStatement(queryEventResource, QUERY_TYPE_PROP, VF.createLiteral(queryType)); statements.add(queryTypeStatement); return statements; }  }
BaseProvenanceModel implements RDFProvenanceModel { public List<Statement> getStatementsForQuery(String query, String user, String queryType) { List<Statement> statements = new ArrayList<Statement>(); Resource queryEventResource = VF.createIRI(QUERY_NAMESPACE + UUID.randomUUID().toString()); Statement queryEventDecl = VF.createStatement(queryEventResource, RDF.TYPE, QUERY_EVENT_TYPE); statements.add(queryEventDecl); Statement queryEventTime = VF.createStatement(queryEventResource, AT_TIME_PROPERTY, VF.createLiteral(new Date())); statements.add(queryEventTime); Statement queryUser = VF.createStatement(queryEventResource, ASSOCIATED_WITH_USER, VF.createLiteral(user)); statements.add(queryUser); Statement executedQuery = VF.createStatement(queryEventResource, EXECUTED_QUERY_PROPERTY, VF.createLiteral(query)); statements.add(executedQuery); Statement queryTypeStatement = VF.createStatement(queryEventResource, QUERY_TYPE_PROP, VF.createLiteral(queryType)); statements.add(queryTypeStatement); return statements; }  List<Statement> getStatementsForQuery(String query, String user, String queryType); }
BaseProvenanceModel implements RDFProvenanceModel { public List<Statement> getStatementsForQuery(String query, String user, String queryType) { List<Statement> statements = new ArrayList<Statement>(); Resource queryEventResource = VF.createIRI(QUERY_NAMESPACE + UUID.randomUUID().toString()); Statement queryEventDecl = VF.createStatement(queryEventResource, RDF.TYPE, QUERY_EVENT_TYPE); statements.add(queryEventDecl); Statement queryEventTime = VF.createStatement(queryEventResource, AT_TIME_PROPERTY, VF.createLiteral(new Date())); statements.add(queryEventTime); Statement queryUser = VF.createStatement(queryEventResource, ASSOCIATED_WITH_USER, VF.createLiteral(user)); statements.add(queryUser); Statement executedQuery = VF.createStatement(queryEventResource, EXECUTED_QUERY_PROPERTY, VF.createLiteral(query)); statements.add(executedQuery); Statement queryTypeStatement = VF.createStatement(queryEventResource, QUERY_TYPE_PROP, VF.createLiteral(queryType)); statements.add(queryTypeStatement); return statements; }  List<Statement> getStatementsForQuery(String query, String user, String queryType);  }