Revision: 1841
Author: [email protected]
Date: Tue Feb  9 05:25:59 2010
Log: Changed filter query to make sure the Projects returned by filterByName are now simal:Projects, not doap:Projects. (fixes issue 245)

http://code.google.com/p/simal/source/detail?r=1841

Modified:
/trunk/uk.ac.osswatch.simal.core/src/main/java/uk/ac/osswatch/simal/service/jena/JenaProjectService.java

=======================================
--- /trunk/uk.ac.osswatch.simal.core/src/main/java/uk/ac/osswatch/simal/service/jena/JenaProjectService.java Tue Feb 2 03:55:34 2010 +++ /trunk/uk.ac.osswatch.simal.core/src/main/java/uk/ac/osswatch/simal/service/jena/JenaProjectService.java Tue Feb 9 05:25:59 2010
@@ -148,6 +148,7 @@
        }

          public IProject getProject(String uri) throws 
SimalRepositoryException {
+ // FIXME This needs rework; will sometimes return doap:Project, sometimes simal:Project
                if(uri.startsWith(RDFUtils.PROJECT_NAMESPACE_URI)) {
                    if (containsProject(uri)) {
return new Project(((JenaSimalRepository)getRepository()).getModel().getResource(uri));
@@ -404,10 +405,13 @@
public Set<IProject> filterByName(String filter) throws SimalRepositoryException { String queryStr = "PREFIX xsd: <" + AbstractSimalRepository.XSD_NAMESPACE_URI
                + "> " + "PREFIX doap: <" + RDFUtils.DOAP_NS + "> "
- + "PREFIX rdf: <" + AbstractSimalRepository.RDF_NAMESPACE_URI + ">" - + "PREFIX simal: <" + AbstractSimalRepository.SIMAL_NAMESPACE_URI + ">"
-               + "SELECT DISTINCT ?project WHERE { ?project a doap:Project;"
-               + "  doap:name ?name . "
+ + "PREFIX rdf: <" + AbstractSimalRepository.RDF_NAMESPACE_URI + "> " + + "PREFIX rdfs: <" + AbstractSimalRepository.RDFS_NAMESPACE_URI + "> " + + "PREFIX simal: <" + AbstractSimalRepository.SIMAL_NAMESPACE_URI + "> "
+               + "SELECT DISTINCT ?project WHERE "
+               + "{ ?project a simal:Project ."
+               + "  ?project rdfs:seeAlso ?doapUri ."
+               + "  ?doapUri doap:name ?name ."
+ " FILTER regex(?name, \"" + convertFilterToRE(filter) + "\", \"i\") }";
            Set<IProject> projects = findProjectsBySPARQL(queryStr);

--
You received this message because you are subscribed to the Google Groups "Simal 
Commits" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/simal-commits?hl=en.

Reply via email to