Page MenuHomePhabricator

Querying for N-Ary property with a type Text fails
Closed, ResolvedPublic

Description

Author: nitsche

Description:
SMW1.0 on MW1.12alpha

Steps to reproduce:

  1. Create an n-ary attribute that uses type:text (http://ontoworld.org/wiki/Property:TestNary)

Type:String, Number, Text

  1. Make some annotations of this property (http://ontoworld.org/wiki/NaryTest)

[[TestNary:=Hello world;42;Some more text]]

  1. Create a query asking for an exact text value, for example:

<ask>[[TestNary:=?;?;Some more text]][[TestNary:=*]]</ask> (http://ontoworld.org/wiki/NaryQueryTest)

Result:

A SQL error appears, stating:

A database query syntax error has occurred. This may indicate a bug in the software. The last attempted database query was:

(SQL query hidden)

from within function "SMW::getQueryResult". MySQL returned error "1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')) ORDER BY page.page_title ASC LIMIT 51' at line 1 (localhost)".

Expected Result:
The query should deliver all pages with "Some more text" annotated in third position of this property.


Version: unspecified
Severity: major
URL: http://ontoworld.org/wiki/NaryQueryTest

Details

Reference
bz12754

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:02 PM
bzimport set Reference to bz12754.
bzimport added a subscriber: Unknown Object (MLST).

This requires some clarification:

  • The fact that SMW throws SQL errors (in any situation whatsoever) is a bug.
  • The fact that you cannot search for exact values of Type:Text is not a bug, but part of the design. Type:Text data is not used in query matching for performance reasons and because it is not expected that any user would search for exact matches of long texts in general. Moreover, Type:Text values do not even have a DB index, for reasons of space.

The *bug* has now been fixed in SVN. The other request remains a "wontfix" -- use Type:String for value matching.