GithubHelp home page GithubHelp logo

erfurt's Introduction

Erfurt

Erfurt is a PHP/Zend based Semantic Web Framework for Social Semantic Software.

CI System Status
Travis CI Travis CI Build Status
owdev Jenkins owdev Build Status

API Documentation

Features

  • RDF Parser/serializer
  • Storage abstraction/RDF Store
  • Versioning
  • SPARQL querying/update
  • Caching
  • Plugins/trigger
  • ...

Developer Info

Repository Conventions

We use Vincent Driessen's branching model, Tom Preston-Werner's versioning specification as well as this note on good commit messages for this repository.

In addition to that, we suggest to use git-flow to keep naming conventions. Copy the following config section in you global ~/.gitconfig or the repository wide .git/config file.

# git flow default configuration for ~/.gitconfig
[gitflow "branch"]
    master = master
    develop = develop
[gitflow "prefix"]
    feature = feature/
    release = release/
    hotfix = hotfix/
    support = support/
    versiontag = v

Code Conventions

Currently, this library is developed using OntoWiki's coding standard.

erfurt's People

Contributors

0xfeedface avatar bergo avatar brummbq avatar cannelony avatar criess avatar cupakob avatar dependabot[bot] avatar florianagsten avatar haschek avatar jbrekle avatar k00ni avatar kriss0r avatar larseidam avatar matthimatiker avatar michaelmartin avatar nareike avatar olberger avatar pfrischmuth avatar seebi avatar shinobu avatar simeonackermann avatar splattater avatar tpluscode avatar white-gecko avatar yamalight avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

erfurt's Issues

RDF/XML Export does not work

Exporting a Knowledge Base as RDF/XML does not work. It only exports the prefixes, but no data.

All other formats work as expected AFIK.

Model creation failure with Virtuoso

Failed creating the model. Reason:
SPARQL Error: [OpenLink][Virtuoso iODBC Driver][Virtuoso Server]SR012:
Function aref needs a string or an array as argument 1, not an arg of type DB_NULL (204)
() in query: CREATE SILENT GRAPH <http://foo>.

Virtuoso info:

  • Version: 06.01.3127
  • Build: Apr 12 2012

Turtle parser should support qnames without local part

According to [1] resp. [2] it is allowed to use just the prefix without local part in turtle.

@prefix rdf:  <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix void: <http://rdfs.org/ns/void#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
…
rdf:  rdfs:label "" ;
      void:exampleResource
rdf: .

This is currently parsed to the triples:

<http://www.w3.org/1999/02/22-rdf-syntax-ns#> <http://www.w3.org/2000/01/rdf-schema#label> "" .
<http://www.w3.org/1999/02/22-rdf-syntax-ns#> <http://rdfs.org/ns/void#exampleResource> <http://www.w3.org/1999/02/22-rdf-syntax-ns# .> .

Which is obviously wrong (Se the . before the last closing >).

[1] http://answers.semanticweb.com/questions/3239/can-qname-be-used-without-a-local-name-part
[2] http://www.w3.org/TeamSubmission/turtle/#sec-grammar-grammar (point 27)

Getting Started: Authentication should be loaded from config

When following https://github.com/AKSW/Erfurt/wiki/Getting-Started I got the impression that

# Authentification on OntoWiki (need for model access)
$app->authenticate( 'root', 'root' );

uses usernames and passwords that have been created with ontowiki, even if I don't have any ontowiki instance.

I could however use the store.zenddb.username and store.zenddb.password values from the config file without problems.

If that's wrong, please clarify that on the page. (https://github.com/AKSW/Erfurt/wiki/Internals specifically tells you to use those value). Also show how to use the settings from the config file without loading it myself, since erfurt should have loaded it automatically.

And why doesn't Erfurt use those settings automatically?

cache db backend: Invalid argument supplied for foreach()

From Jeff:

I downloaded the new archive, edited the config.ini-dist file, typed
localhost/ontowiki in my browser, and it seems to work! There was an
error message sort of hiding behind the contents of the page

Warning: Invalid argument supplied for foreach() in C:\xampp\htdocs
\ontowiki\libraries\Erfurt\Erfurt\Cache\Backend\Database.php on line 267

When I typed my login information, the error disappeared

Prettier output from Erfurt RDF/Turtle export

The Turtle source as exported from
http://data.bbib.no/source/edit/r/Nordahl_Grieg
is not very readable for the part containing frbr:creatorOf. Never mind the frbr:creatorOf appearing twice. This is an error on my part whilst using OntoWiki, adding a separate instance of a property widget for frbr:creatorOf, instead of using the + button to expand the widget. This is an OntoWiki issue, I suppose.

The readability of the line

                frbr:creatorOf <http://data.bbib.no/data/17._mai_1914>, <http://data.bbib.no/data/Ung%20m%C3%A5%20verden%20ennu%20v%C3%A6re>, <http://data.bbib.no/data/Ung%20m%C3%A5%20verden%20ennu%20v%C3%A6re%20%3A%20roman>, <http://data.bbib.no/data/V%C3%A5r%20%C3%A6re%20og%20v%C3%A5r%20makt> ;

is what concerns this issue.

Exporting this as

                frbr:creatorOf <http://data.bbib.no/data/17._mai_1914>, 
                                <http://data.bbib.no/data/Ung%20m%C3%A5%20verden%20ennu%20v%C3%A6re>, 
                                <http://data.bbib.no/data/Ung%20m%C3%A5%20verden%20ennu%20v%C3%A6re%20%3A%20roman>, 
                                <http://data.bbib.no/data/V%C3%A5r%20%C3%A6re%20og%20v%C3%A5r%20makt> ;

would be more readable, and still valid Turtle syntax, I suppose.

;)Frode

Method to generate new URIs (like auto_increment)

When adding new statements to a store/model that e.g. are blank nodes, or just URIs you don't care about, one often uses a URL like

http://example.org/some/uri/$index

$index is being counted up here.

Currently, Erfurt offers no method to get a new URI based on the prefix (http://example.org/some/uri/), which makes it hard to continously generate such URIs among several PHP calls. It leads to code like this (from Syntax/RdfParser/Adapter/Turtle.php):

        while (true) {
           $id = self::BNODE_PREFIX . ++$this->_bnodeCounter;
           if (!isset($this->_usedBnodeIds[$id])) {
               break;
           }
       }    

This is also the same code I have to use to do that in my application. This code is very slow if you have to do that against a database.

Erfurt should offer a method to create such incrementing URIs. I imagine something like this:

var_dump($model->getNextFreeUri('http://example.org/some/uri/'));
string(xx) "http://example.org/some/uri/3721"
var_dump($model->getNextFreeUri('http://example.org/some/uri/'));
string(xx) "http://example.org/some/uri/3722"

Exception: Variable "" not selected

Hi,
is it Erfurt or OntoWiki related? I use Erfurt, because of the Exception from Erfurt.

I add some triples about our own extension ( forms.ontowiki). After that i wanted to get an overview about my new triples in the Resource view of OW ( http://localhost/dispedia/resource/instances ).

After click the item "M firstnameM lastname", i got follow error > Erfurt_Sparql_EngineDb_SqlGeneratorException: Variable "" not selected. > http://pastebin.com/44AmNHa4 (complete Stack trace)

Here is the faulty entry > http://pastebin.com/97cxJs0T

Maybe, are the white spaces in the subject prompt the error?

greeting

SPARQL answers with wrong dataformat

SPARQL answers with wrong dataformat.

Import this Resource into a virtuoso backed OntoWiki:

<http://localhost/activity/1/> a aair:Activity ;
    aair:activityActor <http://comiles.eu/natanael.rdf#me> ;
    ns3:published "2012-01-01T00:00:01+02:00"^^xsd:dateTime ;
    aair:activityVerb aair:Post ;
    aair:activityObject <http://localhost/object/1/> .

Do following query with the QueryEditor and with the Virtuoso Conductor

PREFIX atom: <http://www.w3.org/2005/Atom/>
PREFIX aair: <http://xmlns.notu.be/aair#>
SELECT ?activity ?date ?verb ?object
WHERE {
    ?activity a aair:Activity ;
              aair:activityActor  <http://comiles.eu/natanael.rdf#me> ;
              atom:published      ?date ;
              aair:activityVerb   ?verb ;
              aair:activityObject ?object .
}

correct answer by Virtuoso and OW with ZendDB

activity: http://localhost/1/
date: 2012-01-01T00:00:01+02:00
verb: http://xmlns.notu.be/aair#Post
object: http://localhost/object/1/

wrong answer by OW with Virtuoso

activity: http://localhost/1/
date: 2012-01-01 00:00:01
verb: http://xmlns.notu.be/aair#Post
object: http://localhost/object/1/

As you can see the date format is converted before the query result is returned.

Same with $model->sparqlQuery($query).

Wrong handling of graph in SPARQL-execution

In Erfurt_Store_Adapter_Virtuoso there are multiple issues when executing a sparql-query.

Erfurt_Store_Adapter_Virtuoso::_execSparql():
When $graphUri = null, in Virtuoso 06.01.3127 odbc_exec() rises an exception "Fatal error: Out of memory (allocated 10485760) (tried to allocate 18446744073709551613 bytes)" (nearly 2^64 on 64bit-system). This is, because Virtuoso comes in trouble (also in ISQL console) when a graph named 'NULL' passed to DB.DBA.SPARQL_EVAL(). So it's only possible to quote the graph name when it's not null, otherwise real NULL must be passed as this parameter to virtuoso.

Erfurt_Store_Adapter_Virtuoso::_execSparqlUpdate():
Here we also have the param $graphUri, also used nowhere in the class like in Erfurt_Store_Adapter_Virtuoso::_execSparql(). The default graph definition is created in $graphSpec, but not in use. Is it possible to add a comment why to use DB.DBA.SPARQL_EVAL in _execSparql(), but a simple SPARQL in _execSparqlUpdate()? Furthermore the PHPDoc is missing for this method.

Invalidation of Object & Query Cache results in a warning

When I select Object & Query Cache from the debug menu I get the following Warning (I'm using cache.backend.type = "database"):

( ! ) Warning: odbc_exec(): SQL error: [unixODBC][OpenLink][Virtuoso iODBC Driver][Virtuoso Server]SQ200: No table ef_cache_query_result, SQL state S0002 in SQLExecDirect in /home/…/public_html/OntoWiki/libraries/Erfurt/library/Erfurt/Store/Adapter/Virtuoso.php on line 1061
Call Stack
#   Time    Memory  Function    Location
1   0.0000  237920  {main}( )   ../index.php:0
2   4.3227  4303800 Zend_Application->run( )    ../index.php:188
3   4.3227  4303920 Zend_Application_Bootstrap_Bootstrap->run( )    ../Application.php:366
4   4.3228  4305776 Zend_Controller_Front->dispatch( )  ../Bootstrap.php:97
5   4.3256  4345760 Zend_Controller_Plugin_Broker->routeShutdown( ) ../Front.php:923
6   4.3257  4347104 OntoWiki_Controller_Plugin_SetupHelper->routeShutdown( )    ../Broker.php:260
7   4.3260  4347784 Erfurt_Store->getModel( )   ../SetupHelper.php:57
8   4.3260  4347832 Erfurt_Store->isModelAvailable( )   ../Store.php:810
9   4.3260  4347880 Erfurt_Store->_checkAc( )   ../Store.php:1130
10  4.3261  4348800 Erfurt_Ac_Default->isModelAllowed( )    ../Store.php:1813
11  4.3276  4355472 Erfurt_Ac_Default->_getUserModelRights( )   ../Default.php:285
12  4.3277  4366424 Erfurt_Ac_Default->_sparql( )   ../Default.php:551
13  4.3277  4367552 Erfurt_Store->sparqlQuery( )    ../Default.php:719
14  4.3281  4368984 Erfurt_Store->_prepareQuery( )  ../Store.php:1408
15  4.3291  4380536 Erfurt_Store->getImportsClosure( )  ../Store.php:1316
16  4.3291  4380768 Erfurt_Store->_getImportsClosure( ) ../Store.php:748
17  4.3291  4381016 Erfurt_Store_Adapter_Virtuoso->getImportsClosure( ) ../Store.php:770
18  4.3296  4417984 Erfurt_Cache_Frontend_QueryCache->load( )   ../Virtuoso.php:918
19  4.3297  4418208 Erfurt_Cache_Backend_QueryCache_Database->load( )   ../QueryCache.php:112
20  4.3297  4418648 Erfurt_Cache_Backend_QueryCache_Database->_query( ) ../Database.php:231
21  4.3297  4418792 Erfurt_Store->sqlQuery( )   ../Database.php:846
22  4.3297  4418840 Erfurt_Store_Adapter_Virtuoso->sqlQuery( )  ../Store.php:1503
23  4.3297  4419128 Erfurt_Store_Adapter_Virtuoso->_execSql( )  ../Virtuoso.php:777
24  4.3298  4419176 odbc_exec ( )   ../Virtuoso.php:1061

Resource URI's with urlencoded characters are problematic

I , perhaps wrongly, filed this issue in AKSW/OntoWiki#151. Please look there for a detailed bug report.

Whenever there exists in the knowledge base resources with special characters in their names, things does not work as expected. Links are broken, and some views, such as the "Source" tab, does not work properly.

I had created a test resources to explain the problem. Theese were created using OntoWiki. As can be seen, the Turtle source is correct, but the OntoWiki interaction with them are not.

Regretfully the test resources are no longer available on my server, but the Turtle source can be used to recreate them fot testing purposes.

;)Frode

error running tests

PHPUnit 3.6.10 by Sebastian Bergmann.

Configuration read from /home/jonas/programming/php-workspace/ow/libraries/Erfurt/phpunit.xml.dist

.........PHP Fatal error: Call to a member function isVersioningEnabled() on a non-object in /home/jonas/programming/php-workspace/ow/libraries/Erfurt/tests/Erfurt/AppTest.php on line 176

PHP Stack trace:

add support for blank nodes

Blank nodes are treated as strings currently, leading to duplicate blank node names when importing multiple RDF files (and thus data confusion).

The problem lies in Erfurt_Store_Adapter_Virtuoso::addStatement() which adds triples one by one, instead of storing them together so that real blank nodes can be used.

Why re-authentication to create new model?

This issue occurs in relation to OntoWiki! I am in an action of a controller.

For instance:

class CollaboController extends OntoWiki_Controller_Component {

   /**
    * Import an ontology for given URI
    */
   public function importontologyAction () {

The plan is to create a new model via

$this->_erfurt->getStore()->getNewModel($ontologyUri, '', $newType);

But when iam doing this, it throws an exception that this operation is not allowed. For the record, i am logged in as Admin.

It runs perfectly when i authenticate myself again:

$backend = $this->_erfurt->getConfig()->store->backend;
$username = $this->_erfurt->getConfig()->store->{$backend}->username;
$password = $this->_erfurt->getConfig()->store->{$backend}->password;

$this->_erfurt->authenticate($username, $password);

After that i am able to create a new model. But was that your intention? I thought OntoWiki handle Erfurt authentication by itself.

Ping improvements

Additionally to #40 following things should be improved for the Erfurt_Ping class:

  • receive() should return true or false
  • an additional method getStatusCode()
  • an additional method getTriples() which returns the new data from the source
  • receive() should not always write the received triples to the store
  • to make the pingback service usable for Erfurt standalone we have to move parts of linkeddataserver plugin to erfurt
  • specify target graph for the ping to go in options
  • add config option to also trigger onPingReceivedAgain event (AKSW/OntoWiki/issues/90)

Owl2Structured.php missing?

When I want to view an instance I get the following error:

Warning: include(Erfurt/Owl/Structured/Util/Owl2Structured.php): failed to open stream: No such file or directory in /usr/share/ontowiki/libraries/Zend/Loader.php on line 83

The file is not included?

Unexpected T_PAAMAYIM_NEKUDOTAYIM

A fresh install of OntoWiki fails to run on Windows (PHP 5.2) failing in Erfurt\Store\Adapter\Virtuoso.php with the above message.

Solution is to change line

if ($result == $queryCache::ERFURT_CACHE_NO_HIT) {

to

if ($result == Erfurt_Cache_Frontend_QueryCache::ERFURT_CACHE_NO_HIT) {

Template format pxml needs "short tags" to be disabled

While running tests I stumbled upon an error while including a template.
This template starts with a XML header which leads to a syntax error on include.
This error is avoidable by configuring PHP to NOT allow short tags.
For sure, your environment has been configured this way - however mine was not.

Solution:
Set PHP option "short_tags" to "off" in php.ini.
Do this for /etc/php5/cli/php.ini if you want to run unit tests.

It should be:

  • either noted somewhere to turn short tags off
  • or checked if short tags are off when using this template format using include

Should getNewModel return an existing Model?

Should the method Erfurt_Store->getNewModel() return the model if it already exists rather than throwing an Exception:

'Erfurt_Store_Exception' with message 'Failed creating the model.'

Or do we have an other method which creates a model if it doesn't exist or returns the existing one?

Integration of a worker queue backend

we need a backend abstraction for dropping worker tasks such as:

  • do a semantic ping
  • push new content
  • email contribtutors
  • create all resources for the site extension
  • re-scale images

some tools for doing this are: gearman, beanstalkd, apache activeMQ and more

as a fallback, we need cron and instant worker queues.

  • cron: save tasks somewhere, where a simle run script can start it
  • instant: do not save tasks, just do them instantly (fallback if nothing is configured)

create knowledge base

During creating a knowledge base using e.g a turtle document it throws an error and a warning.

Warning: odbc_exec(): SQL error: [unixODBC][OpenLink][Virtuoso iODBC Driver][Virtuoso Server]SQ074: Line 171: syntax error at 'focus' before 'lies', SQL state 37000 in SQLExecDirect in /var/www/ontowiki/libraries/Erfurt/Erfurt/Store/Adapter/Virtuoso.php on line 975

The import error is thrown using the develop branch, master branch works fine.

current search in virtuoso broken

a search with the current develop head outputs this error message:

Erfurt_Store_Adapter_Exception: SPARQL Error: [unixODBC][OpenLink][Virtuoso iODBC Driver][Virtuoso Server]VD032: remote prepare: SQ200: No column t2.S. () in query: define output:format "JSON" SELECT DISTINCT ?resourceUri FROM http://localhost/OntoWiki/Config/ FROM http://ns.ontowiki.net/SysOnt/ WHERE { ?listresource ?p0 ?o0 . ?listresource ?resourceUri ?showPropsObj FILTER (!isBLANK(?resourceUri)) FILTER (bif:contains(?o0, '"Usergroup*"')) } ORDER BY ASC(?resourceUri)
/home/seebi/var/www/ow/tip/libraries/Erfurt/Erfurt/Store/Adapter/Virtuoso.php@957

This issue was introduces by revision 1e05aef of Erfurt/Store/Adapter/Virtuoso.php

Max column length (255) of column 'DB.DBA.ef_cache_query_triple.subject' exceeded ()

After importing the dataset from the file into OntoWiki I've got the following error.

Dataset:
https://dl.dropboxusercontent.com/u/4882345/lodstats-complete.rdf

Error:
Something went wrong with the query cache: SQL Error: [unixODBC][OpenLink][Virtuoso iODBC Driver][Virtuoso Server]SR319: Max column length (255) of column 'DB.DBA.ef_cache_query_triple.subject' exceeded () in query: INSERT INTO ef_cache_query_triple ( subject, predicate, object) VALUES ( 'http://famu.eagle-i.net/sparqler/sparql?view=published-resources&format=text/turtle&query=PREFIX+rdfs%3A+%3Chttp%3A%2F%2Fwww.w3.org%2F2000%2F01%2Frdf-schema%23%3E+PREFIX+%3A+%3Chttp%3A%2F%2Feagle-i.org%2Font%2Frepo%2F1.0%2F%3E+construct+%7B%3Fs+%3Fp+%3Fo+.+%3Fp+rdfs%3Alabel+%3Fp_label+.+%3Fo+rdfs%3Alabel+%3Fo_label%7D+where+%7Bgraph+%3ANG_Published%7B%3Fs+%3Fp+%3Fo%7D+.+optional%7B%3Fp+rdfs%3Alabel+%3Fp_label+%7D+.+optional%7B+%3Fo+rdfs%3Alabel+%3Fo_label%7D%7D+', NULL, NULL) SQL:INSERT INTO ef_cache_query_triple ( subject, predicate, object) VALUES ( 'http://famu.eagle-i.net/sparqler/sparql?view=published-resources&format=text/turtle&query=PREFIX+rdfs%3A+%3Chttp%3A%2F%2Fwww.w3.org%2F2000%2F01%2Frdf-schema%23%3E+PREFIX+%3A+%3Chttp%3A%2F%2Feagle-i.org%2Font%2Frepo%2F1.0%2F%3E+construct+%7B%3Fs+%3Fp+%3Fo+.+%3Fp+rdfs%3Alabel+%3Fp_label+.+%3Fo+rdfs%3Alabel+%3Fo_label%7D+where+%7Bgraph+%3ANG_Published%7B%3Fs+%3Fp+%3Fo%7D+.+optional%7B%3Fp+rdfs%3Alabel+%3Fp_label+%7D+.+optional%7B+%3Fo+rdfs%3Alabel+%3Fo_label%7D%7D+', NULL, NULL)

Traceback:

Erfurt_Exception

/var/local/cubeviz.vhost.tld/libraries/Erfurt/library/Erfurt/Cache/Backend/QueryCache/Database.php@852 
#0: Erfurt_Cache_Backend_QueryCache_Database->_query@/var/local/cubeviz.vhost.tld/libraries/Erfurt/library/Erfurt/Cache/Backend/QueryCache/Database.php:750
#1: Erfurt_Cache_Backend_QueryCache_Database->_saveTriplePatterns@/var/local/cubeviz.vhost.tld/libraries/Erfurt/library/Erfurt/Cache/Backend/QueryCache/Database.php:196
#2: Erfurt_Cache_Backend_QueryCache_Database->save@/var/local/cubeviz.vhost.tld/libraries/Erfurt/library/Erfurt/Cache/Frontend/QueryCache.php:86
#3: Erfurt_Cache_Frontend_QueryCache->save@/var/local/cubeviz.vhost.tld/libraries/Erfurt/library/Erfurt/Store.php:1503
#4: Erfurt_Store->sparqlQuery@/var/local/cubeviz.vhost.tld/application/classes/OntoWiki/Model/TitleHelper.php:401
#5: OntoWiki_Model_TitleHelper->getTitleQueryResult@/var/local/cubeviz.vhost.tld/application/classes/OntoWiki/Model/TitleHelper.php:494
#6: OntoWiki_Model_TitleHelper->_fetchResourceTitlesFromQueryResult@/var/local/cubeviz.vhost.tld/application/classes/OntoWiki/Model/TitleHelper.php:321
#7: OntoWiki_Model_TitleHelper->getTitle@/var/local/cubeviz.vhost.tld/extensions/cubeviz/classes/DataCube/Query.php:95
#8: DataCube_Query->enrichResult@/var/local/cubeviz.vhost.tld/extensions/cubeviz/classes/DataCube/Query.php:319
#9: DataCube_Query->getComponentElements@/var/local/cubeviz.vhost.tld/extensions/cubeviz/classes/DataCube/Query.php:292
#10: DataCube_Query->getComponents@/var/local/cubeviz.vhost.tld/extensions/cubeviz/classes/CubeViz/ConfigurationLink.php:89
#11: CubeViz_ConfigurationLink->loadStandardConfigForData@/var/local/cubeviz.vhost.tld/extensions/cubeviz/classes/CubeViz/ConfigurationLink.php:342
#12: CubeViz_ConfigurationLink->read@/var/local/cubeviz.vhost.tld/extensions/cubeviz/classes/CubeViz/ViewHelper.php:106
#13: CubeViz_ViewHelper::initApp@/var/local/cubeviz.vhost.tld/extensions/cubeviz/DataselectionModule.php:137
#14: DataselectionModule->getContents@/var/local/cubeviz.vhost.tld/application/classes/OntoWiki/View.php:266
#15: OntoWiki_View->module@/var/local/cubeviz.vhost.tld/application/classes/OntoWiki/View.php:151
#16: OntoWiki_View->modules@/var/local/cubeviz.vhost.tld/application/classes/OntoWiki/Controller/Base.php:188
#17: OntoWiki_Controller_Base->preDispatch@/var/local/cubeviz.vhost.tld/libraries/Zend/Controller/Action.php:502
#18: Zend_Controller_Action->dispatch@/var/local/cubeviz.vhost.tld/libraries/Zend/Controller/Dispatcher/Standard.php:295
#19: Zend_Controller_Dispatcher_Standard->dispatch@/var/local/cubeviz.vhost.tld/libraries/Zend/Controller/Front.php:954
#20: Zend_Controller_Front->dispatch@/var/local/cubeviz.vhost.tld/libraries/Zend/Application/Bootstrap/Bootstrap.php:97
#21: Zend_Application_Bootstrap_Bootstrap->run@/var/local/cubeviz.vhost.tld/libraries/Zend/Application.php:366
#22: Zend_Application->run@/var/local/cubeviz.vhost.tld/index.php:174

Sparql Query2 creates incorrect count query

Code:

$query = new Erfurt_Sparql_Query2();
$query->addProjectionVar(new Erfurt_Sparql_Query2_Var('resourceUri'));
$query->setCountStar(true);
$query->setDistinct();
$query->addElements(NavigationHelper::getInstancesTriples($uri, $setup));

Expected output:

SELECT ?resourceUri COUNT(DISTINCT ?resourceUri) 
WHERE { ... } 

Actual output:

SELECT DISTINCT COUNT(*) 
WHERE { ... } 

SimpleQuery count() as doesn't work

The following query doesn't work (SimpleQuery just removes the count(…) as … part)

prefix ctag: <http://commontag.org/ns#> 
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> 
select distinct ?tag ?label count(?tag) as ?weight {
  ?resource ctag:tagged ?tag . 
  optional { { ?tag ctag:label ?label } union { ?tag rdfs:label ?label } } 
} order by ?label

strict standard problem antlr

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.