Package model.array

Examples of model.array.SearchableObjectArray


        runtimePanel.setText(runtimePanel.getText().replace("N/A", correctRuntime(Double.parseDouble(removeLiteral(result.get("runtime").toString()))) + " minutes"));

      if (result.contains("year"))
        yearPanel.setText(yearPanel.getText().replace("N/A", removeLiteral(result.get("year").toString())));
     
      SearchableObjectArray actors = getActors(uri);
      if (!actors.isEmpty()) {
        String html = "<ul>";
        for (SearchableObject actor : actors) {
          html += "<li>" + actor.getTitle() + "</li>";
        } html += "</ul>";
        starringPanel.setText(starringPanel.getText().replace("N/A", html));
View Full Code Here


                  "uri: dbpedia-owl:starring ?actor ." +
                  "?actor h2mdb:name ?name." +
                "}";

    ResultSet rs2 = OntologyQueryer.resultQuery(queryStarring);
    SearchableObjectArray list = new SearchableObjectArray();
    while(rs2.hasNext()) {
      QuerySolution q = rs2.next();
      list.add(new Actor(q.get("actor").toString(), removeLiteral(q.get("name").toString())));
    }
   
    return list;
  }
View Full Code Here

//    System.out.println("quicksearch");
  }

  @Override
  public void performingFullSearch(String searchText) {
    SearchableObjectArray results = new SearchableObjectArray();
   
    try {
      String queryMovieText = "SELECT DISTINCT ?uri ?title WHERE {" +
          "?uri rdf:type h2mdb:Film . " +
          "?uri h2mdb:name ?title . " +
          "FILTER (REGEX(STR(?title), \"" + searchText + "\", \"i\")) " +
          "}";
     
      ResultSet resultSetMovies = OntologyQueryer.resultQuery(queryMovieText);
      while (resultSetMovies.hasNext()) {
        QuerySolution item1 = resultSetMovies.next();
        results.add(new Movie(item1.get("uri").toString(), item1.get("title").toString().replace("@en", "")));
      }
     
      String queryActorText = "SELECT DISTINCT ?uri ?title WHERE { " +
          "?uri rdf:type h2mdb:Actor . " +
          "?uri h2mdb:name ?title . " +
          "FILTER (REGEX(STR(?title), \"" + searchText + "\", \"i\")) " +
          "}";
      ResultSet resultSetActors = OntologyQueryer.resultQuery(queryActorText);
     
      while (resultSetActors.hasNext()) {
        QuerySolution item2 = resultSetActors.next();
        results.add(new Actor(item2.get("uri").toString(), item2.get("title").toString().replace("@en", "")));
      }
     
      Collections.sort(results, new SearchableComparator());
      window.getHistory().add(new SearchResultView(window.getPanelCount(), new SearchController(), results));
    } catch (NullPointerException e) {
View Full Code Here

import com.hp.hpl.jena.query.ResultSet;

public class ActorDecadeController extends DecadeController {
  @Override
  public void decadeSelected(String uri) {
    SearchableObjectArray results = new SearchableObjectArray();
   
    Window window = MainController.getInstance().getWindow();
    HistoryArray history = window.getHistory();
   
    String queryText =   "SELECT DISTINCT ?actor ?title WHERE { " +
                "?film rdf:type <" + uri + "> . " +
                "?film dbpedia-owl:starring ?actor . " +
                "?actor h2mdb:name ?title . " +
              "} ";
    ResultSet resultSet = OntologyQueryer.resultQuery(queryText);
    while(resultSet.hasNext()) {
      QuerySolution solution = resultSet.next();
      results.add(new Actor(solution.get("actor").toString(), solution.get("title").toString().replace("@en", "")));
    }
   
    Collections.sort(results, new SearchableComparator());
    history.add(new SearchResultView(window.getPanelCount(), new SearchController(), results));
  }
View Full Code Here

import com.hp.hpl.jena.query.ResultSet;

public class FilmDecadeController extends DecadeController {
  @Override
  public void decadeSelected(String uri) {
    SearchableObjectArray results = new SearchableObjectArray();
   
    Window window = MainController.getInstance().getWindow();
    HistoryArray history = window.getHistory();
   
    String queryText =   "SELECT ?uri ?title WHERE { " +
                "?uri rdf:type <" + uri + "> . " +
                "?uri h2mdb:name ?title . " +
              "} ";
    ResultSet resultSet = OntologyQueryer.resultQuery(queryText);
    while(resultSet.hasNext()) {
      QuerySolution solution = resultSet.next();
      results.add(new Movie(solution.get("uri").toString(), solution.get("title").toString().replace("@en", "")));
    }
   
    Collections.sort(results, new SearchableComparator());
    history.add(new SearchResultView(window.getPanelCount(), new SearchController(), results));
  }
View Full Code Here

import com.hp.hpl.jena.query.ResultSet;

public class ListAllFilmsController implements ActionListener {
  @Override
  public void actionPerformed(ActionEvent e) {
    SearchableObjectArray results = new SearchableObjectArray();
   
    String queryText =  "SELECT DISTINCT ?uri ?title WHERE { " +
                "?uri rdf:type h2mdb:Film . " +
                "?uri h2mdb:name ?title . " +
              "} ";
    ResultSet resultSet = OntologyQueryer.resultQuery(queryText);
    while (resultSet.hasNext()) {
      QuerySolution result = resultSet.next();
      results.add(new Movie(result.get("uri").toString(), result.get("title").toString().replace("@en", "")));
    }
   
    Collections.sort(results, new SearchableComparator());
    Window window = MainController.getInstance().getWindow();
    window.getHistory().add(new SearchResultView(window.getPanelCount(), new SearchController(), results));
View Full Code Here

import com.hp.hpl.jena.query.ResultSet;

public class ListAllActorsController implements ActionListener {
  @Override
  public void actionPerformed(ActionEvent e) {
    SearchableObjectArray results = new SearchableObjectArray();
   
    String queryText =  "SELECT DISTINCT ?uri ?title WHERE { " +
                "?uri rdf:type h2mdb:Actor . " +
                "?uri h2mdb:name ?title . " +
              "} ";
    ResultSet resultSet = OntologyQueryer.resultQuery(queryText);
    while (resultSet.hasNext()) {
      QuerySolution result = resultSet.next();
      results.add(new Actor(result.get("uri").toString(), result.get("title").toString().replace("@en", "")));
    }
   
    Collections.sort(results, new SearchableComparator());
    Window window = MainController.getInstance().getWindow();
    window.getHistory().add(new SearchResultView(window.getPanelCount(), new SearchController(), results));
View Full Code Here

TOP

Related Classes of model.array.SearchableObjectArray

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.