incubator-clerezza-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hasan (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (CLEREZZA-33) serialization of sparql query containing filter with regex fails
Date Tue, 15 Dec 2009 12:57:18 GMT

     [ https://issues.apache.org/jira/browse/CLEREZZA-33?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Hasan resolved CLEREZZA-33.
---------------------------

    Resolution: Fixed

> serialization of sparql query containing filter with regex fails
> ----------------------------------------------------------------
>
>                 Key: CLEREZZA-33
>                 URL: https://issues.apache.org/jira/browse/CLEREZZA-33
>             Project: Clerezza
>          Issue Type: Bug
>            Reporter: Hasan
>            Assignee: Hasan
>
> The following test fails
> 	@Test
> 	public void testRegex() {
> 		final String queryString = "SELECT ?p WHERE { " +
> 				"<http://localhost/testitem> ?p ?x . " +
> 				"FILTER REGEX(?x,\".*uni.*\"^^<http://www.w3.org/2001/XMLSchema#string>) }";
> 		Variable p = new Variable("p");
> 		SimpleSelectQuery selectQuery = new SimpleSelectQuery();
> 		selectQuery.addSelection(p);
> 		Variable x = new Variable("x");
> 		Set<TriplePattern> triplePatterns = new HashSet<TriplePattern>();
> 		triplePatterns.add(new SimpleTriplePattern(
> 				new UriRef("http://localhost/testitem"), p, x));
> 		SimpleBasicGraphPattern bgp = new SimpleBasicGraphPattern(triplePatterns);
> 		SimpleGroupGraphPattern queryPattern = new SimpleGroupGraphPattern();
> 		queryPattern.addGraphPattern(bgp);
> 		List<Expression> arguments = new ArrayList<Expression>();
> 		arguments.add(x);
> 		arguments.add(new LiteralExpression(LiteralFactory.getInstance().
> 				createTypedLiteral(".*uni.*")));
> 		BuiltInCall constraint = new BuiltInCall("REGEX", arguments);
> 		queryPattern.addConstraint(constraint);
> 		selectQuery.setQueryPattern(queryPattern);
> 		Assert.assertTrue(selectQuery.toString()
> 				.replaceAll("( |\n)+", " ").trim().equals(queryString));
> 	}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message