Package JOINT

Examples of JOINT.Kao


    private final String collectionsOntologyURI = "http://dblp.l3s.de/d2r/all/Collections";
    private final String swrcOntologyURI = "http://swrc.ontoware.org/ontology";
    private final String ontoAppOntologyURI = "http://www.nees.com.br/ontologies/2014/ontoApp";

    public List<String> searchResearchersByName(String personName) {
        Kao kaoPerson = new Kao(Agent.class, swrcOntologyURI);
        String query = "PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>\n"
                + "PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>\n"
                + "PREFIX foaf:<http://xmlns.com/foaf/0.1/>\n"
                + "SELECT ?name\n"
                + "WHERE{?subject rdf:type foaf:Agent.\n"
                + "      ?subject rdfs:label ?name.\n"
                + "FILTER regex(?name,'" + personName + "','i').\n"
                + "}";

        List<? extends Object> researcher = null;
        try {
            researcher = (List<? extends Object>) kaoPerson.executeQueryAsSingleResult(query);
        } catch (Exception e) {
            researcher = null;
        } finally {
            kaoPerson.save();
            return (List<String>) researcher;
        }
    }
View Full Code Here


            return (List<String>) researcher;
        }
    }

    public List<String> searchUniversityByName(String universityName) {
        Kao kaoUniversity = new Kao(University.class, swrcOntologyURI);
        String query = "PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>\n"
                + "PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>\n"
                + "PREFIX swrc:<http://swrc.ontoware.org/ontology/>\n"
                + "SELECT ?name\n"
                + "WHERE{?subject rdf:type swrc:University.\n"
                + "      ?subject rdfs:label ?name.\n"
                + "FILTER regex(?name,'" + universityName + "','i').\n"
                + "}";

        List<? extends Object> university = null;
        try {
            university = (List<? extends Object>) kaoUniversity.executeQueryAsSingleResult(query);
        } catch (Exception e) {
            university = null;
        } finally {
            kaoUniversity.save();
            return (List<String>) university;
        }
    }
View Full Code Here

TOP

Related Classes of JOINT.Kao

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.