Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discussion: Add a controller to components #96

Open
alangrafu opened this issue Mar 15, 2012 · 1 comment
Open

Discussion: Add a controller to components #96

alangrafu opened this issue Mar 15, 2012 · 1 comment

Comments

@alangrafu
Copy link
Owner

The lack of a controller component was an intentional in the first versions of lodspk. However more and more I see the need of it for other functions besides data publishing:

  • You want to add data form other sources
  • You want to manage data using other libraries (e.g., statistical libraries) that are beyond of what lodspk and Haanga can/want to do
  • You want to enable read/write operations
  • You want to control which queries will be executed depending on previous results
    • Corolary: change the endpoint of a query?
  • You want to list all the services, types and uri components available in a lodspk installation without doing a hack :)

For all this, we need to specify:

  • If no controller exists, keep things as usual (execute queries, apply results in template)
  • If controller is available, support:
    • HTTP PUT, DELETE and POST at least
    • Flow control
    • Api for accessing SPARQL endpoint?
    • Others
@ghost ghost assigned timrdf Mar 15, 2012
@alangrafu
Copy link
Owner Author

VERY PRELIMINARY idea of how a controller should look like

require_once('abstractController.php');

class myService extends abstractController{

  public function doGet(){
    global $lodspk;
    global $models;
    $this->query('.'); //run first level of queries (in dir queries/)
    if($lodspk['foo'] == 'bar'){
      $this->query('dbpedia'); //run queries in dir queries/endpoint.dbpedia
    }else{
      $this->query('logd'); //run first in dir queries/endpoint.logd
    }


  public function doDelete($args){
    global $lodspk;
    $uri = Utils::curie2uri($args[1]);
    $this->deleteAll($uri, null); //delete all triples where $uri is involved in the default named graph
  }

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants