LinDA-tools / LindaWorkbench

Linked Data tools for SMEs
http://www.linda-project.eu
MIT License
16 stars 7 forks source link

Search for classes in a datasource #114

Closed dipapaspyros closed 9 years ago

dipapaspyros commented 10 years ago

At this point when searching for classes in a datasource, the following query is executed:

public String getSPARQLQuery(){
        String query = SPARQLHandler.getPrefixes();
        query += " SELECT distinct ?class ?label ";
        query += " WHERE { ?class rdf:type owl:Class. ?class rdfs:label ?label. ?object rdf:type ?class. ";
        query += " FILTER(bound(?label) && langMatches(lang(?label), \"EN\") && REGEX(?label, \""+this.searchString+"\"))}";
        return query;
    }

This method has the drawback that classes without label or with label only in a language other than English will not show up as suggestions, and practically can not be used in the QueryBuilder. If no label is found then the search should be based on the last segment of the class URI (e.g name should return classes with URIs like http://xmlns.com#name and http://xmlns.com/classes/name)

judie90 commented 10 years ago

This has been tackled. Please confirm that it meets your expectations.

dipapaspyros commented 10 years ago

When searching for classes RDFClass.java, line 291, it still seems that the server only lists classes that have an English label. This way, classes without label or with label in a language other than English will not be listed. I would suggest that for developement purposes you use the Engage datasource (public endpoint: http://engagesrv.epu.ntua.gr:8890/sparql), which contains classes like Datasource and Person without any labels. The QueryBuilder works really great with DBPedia!! We should make sure that it is capable of creating queries for other endpoints as well.

judie90 commented 10 years ago

You should be able to search resources with no labels. The documentation should explain it further: https://github.com/LinDA-tools/RDF2Any/blob/master/RESTfulAPIsforRDF2Any.pdf

dipapaspyros commented 10 years ago

Is this possible to do through the QueryBuilder interface? Because right now I'm not able to find anything suggesting a way to achieve that in the RESTful API for RDF2Any documentation mentioned...

judie90 commented 10 years ago

I realised that the documentation is not updated, there is a force_uri_search flag which should get all results, regardless of labels e.g. http://localhost:8081/rdf2any/v1.0/builder/classes?dataset=http://dbpedia.org/sparql&search=ani&force_uri_search=true