Extension talk:Semantic Result Formats

The download method for this extension is really annoying. I want a nice version numbered tar.gz. --Dmb 15:32, 22 January 2009 (UTC)

For example, the page says 1.4.1, but now I got it it says (under special version) 1.4.2. Does that mean I'm running a development version? The nice thing about version numbers is that you know where you are. --Dmb 15:38, 22 January 2009 (UTC)

All formats?
How do I enable (or just list) all results formats? It seems since 'upgrading' that "srfInit('all');" no longer does the trick. --Dmb 15:39, 22 January 2009 (UTC)
 * OK, I did some digging, the 'old' version was labeled 1.4.0, and the 'new' version is r45927

timeline - timelinesize hides events
When I have a query that creates some results (11 rows / 2 cols with default settings) and I then set timelinesize=100px most of the results will just be hidden. Is there a way to change this behaviour? --Fez 07:39, 31 August 2009 (UTC)

Pchart4mw
Hi, please consider adding compatibility with the new extension Pchart4mw. Very good. Comparable in quality to that of GooglePie and GoogleBar. But uses only the local server, ie no need to access external server, you need only install the GD library. Thank you. --Alexandre Porto 11:25, 20 November 2009 (UTC)
 * That is a really brilliant suggestion Msevero 00:53, 26 November 2009 (UTC)

Bug in the "calendar" output, patch included to fix it
When using SRF, the "calendar" output type generates an error when there are no results from the semantic query to put in the calendar. This error is: Notice: Undefined variable: events in /var/www/html/mediawiki/extensions/SemanticResultFormats/Calendar/SRF_Calendar.php on line 121 Here is the patch to fix it: Index: Calendar/SRF_Calendar.php

=
====================================================== --- Calendar/SRF_Calendar.php  (revision 61101) +++ Calendar/SRF_Calendar.php  (working copy) @@ -115,6 +115,8 @@                                       $color = $this->m_params['color']; foreach ($dates as $date) $events[] = array($title, $text, $date, $color); +                      } else  { +                        $events[] = null; }               }


 * This was fixed slightly differently in the SVN source code; thanks for pointing to the problem. Yaron Koren 16:01, 17 February 2010 (UTC)


 * Hi, I'm also receiving this error even with the latest SRF.

Undefined property:SMWWikiPageValue::$display_options in C:\\w\\www\\tids\\extensions\\SemanticResultFormats\\Calendar\\SRF_Calendar.php on line 114


 * SRF latest svn, MW 1.16, SMW 1.5 Msevero 05:55, 24 April 2010 (UTC)


 * This is actually an unrelated error, but I just fixed that one too (I think) in SVN. Please let me know if the fix worked for you... Yaron Koren 21:55, 27 April 2010 (UTC)

IE6/7 Operation Aborted on loading Exhibit
This might be more an issue with the Exhibit JavaScript, but wanted to post here. When I have my ask query in a page using exhibit, the page loads fine under IE8 and Firefox, but I get the annoying operation aborted Popup under IE6 & 7. The default MS advice (http://support.microsoft.com/kb/927917) is to fix the javascript, and also disable debug messages.

The disabling of the "show friendly HTTP error Messages" allow the page to at least finish loading but I still cant get the "Tiles" interface to show up as it does in Firefox. Any help is appreciated.

-Dave


 * I would send an email about this to the semediawiki-user mailing list; I don't know if the Exhibit format developer(s) check this talk page. Yaron Koren 16:03, 17 February 2010 (UTC)


 * Thanks Yaron, issue seemed to subsided, I removed the table view and am not getting error. Will update if I get more info. - Dave Manzolillo


 * Hi, I'm still getting this with SRF 1.4.5. I don't use the table view, but get the crash. Could you please tell me what you did Dave to get this working?
 * Many thanks
 * mitchelln 18th March 2010

Feature request: node background color from category
I'm loving format=graph. It's so fast and simple to use. Thanks very much. Would it be possible to implement the following? To be able to set the background color (and perhaps other graphviz attributes) from the category that the node belongs to. Maybe something like this on a category page:

has graphviz node fillcolor::pink

or maybe this is possible with the string type, and would be more flexible:

has graphviz node attribute::fillcolor=pink

maybe even properties could have the "has graph edge attribute" property?

If you have a hierarchy of categories, I don't know if it would be possible to take the graphviz attributes from the "leaf-most" category? Maybe the attributes could also come from pages? 155.198.150.201 11:05, 23 February 2010 (UTC) (Bob)


 * Here is my first stab at this. It first looks for a node page property whose name matches this regexp: /graphviz.node.attrib/i and adds all the values of this property (e.g. "fillcolor=red") to the graphviz input.  If it didn't find any properties, then it looks in the categories of the node.  It does not follow the category hierarchy.  Perhaps someone could add that.  155.198.150.201 16:30, 25 February 2010 (UTC) (Bob)


 * Actually, thinking about it a bit more, you would probably want to start at the super-most category, adding the attributes to the Graphviz node, then traverse through the sub-categories, adding graphviz attributes as you go, finally you can add the node page's attributes. This is because the last-to-be-defined graphviz attributes are the ones which are used. (e.g. nodename [style=filled,fillcolor=red,fillcolor=green] will display green)  155.198.150.201 16:57, 26 February 2010 (UTC)


 * New patch does what I proposed in the previous comment. Usage is " Has graphviz node attribute::shape=box " on a category or node page 129.31.247.91 22:23, 12 March 2010 (UTC) (It's Bob again.)

Index: GraphViz/SRF_Graph.php

=
====================================================== --- GraphViz/SRF_Graph.php	(revision 62703) +++ GraphViz/SRF_Graph.php	(working copy) @@ -80,6 +80,7 @@ 		$graphInput .= "digraph $this->m_graphName {"; if ($this->m_graphSize!='') $graphInput .= "size=\"$this->m_graphSize\";"; $graphInput .= "rankdir=$this->m_rankdir;"; +		$store = smwfGetStore; while ( $row = $res->getNext ) { $firstcol = true; @@ -92,16 +93,38 @@ 					if ($firstcol) { $firstcolvalue = $object->getShortText($outputmode); - 					} +                                       $nodeAttributes = array; +					$nodeLinkTitle = Title::newFromText($text); if ($this->m_graphLink==true){ -						$nodeLinkTitle = Title::newFromText($text); $nodeLinkURL = $nodeLinkTitle->getLocalURL; -						$graphInput .= " \"$text\" [URL = \"$nodeLinkURL\"]; "; +						$nodeAttributes[] = "URL = \"$nodeLinkURL\""; } +					// add graphviz attributes from categories (deepest first) +					// then the node page itself (will override categories if needed) + +					$titles = SRFGraph::getAllCategories($nodeLinkTitle, 10); +					$titles[] = $nodeLinkTitle; + +					foreach ($titles as $title) { +					 $semantic_data = $store->getSemanticData($title); +					 $properties = $semantic_data->getProperties; +					 foreach ($properties as $prop) { +					   if (preg_match("/graphviz.node.attrib/i", $prop->getWikiValue)) { +					     $prop_vals = $semantic_data->getPropertyValues($prop); +					     foreach ($prop_vals as $prop_val) { +						$nodeAttributes[] = $prop_val->getWikiValue; +					     } +					    } +					  } +					} + +					if (sizeof($nodeAttributes) > 0) { +					 $graphInput .= " \"$text\" [".implode(",", $nodeAttributes)."]; "; +                                       } 					if (!$firstcol) { $graphInput .= " \"$firstcolvalue\" -> \"$text\" "; if (($this->m_graphLabel==true) || ($this->m_graphColor==true)){ @@ -151,4 +174,20 @@ 		} 		return $result; } + +	function getAllCategories($title, $depth) { +	 if ($depth == 0) { +	   return array; +	 } +	  $subcategories = array; +	 $result = array; +	 foreach (array_keys($title->getParentCategories) as $category) { +	   $t = Title::newFromText($category); +	   $subcategories[] = $result[] = $t; +	 } +	  foreach ($subcategories as $subcategory) { +	   $result = array_merge(SRFGraph::getAllCategories($subcategory, $depth - 1), $result); +	 } +	  return $result; +	} }

exhibit bug?
Hi

I'm getting this error when using exhibit

File does not exist: C:/UniServer/www/tids/extensions/SemanticResultFormats/Exhibit/exhibit/locales/en-US, referer: http://localhost/tids/index.php?title=Test

and

File does not exist: C:/UniServer/www/tids/__history__.html, referer: http://localhost/tids/index.php?title=Test

cheers

Msevero 03:31, 26 March 2010 (UTC)

(math) Thousand separator
Hi

I'm using SVN version recently a code was added for a thousand separator.Its nice to have that separator but problem is if the result is being parsed (#expr:) it create a parser error. I was wondering if there's any solution or work around ?

cheers

Msevero 06:26, 7 April 2010 (UTC)


 * This is a bug that should be fixed, IMO. I propose that, when at least one of the additional properties has the 'raw' output format specified (?Additional property#-), the math result formats' output should also be 'raw', i.e. without thousands separators. If that's not possible, there should be a new parameter to the math result formats to get the old behaviour back. In our Wiki, the output of an #ask query with 'sum' result format gets multiplied by a number, using the #expr parser function. This multiplication does no longer work, because of the thousands separator. --Patrick Nagel 06:28, 5 July 2010 (UTC)
 * For now I changed line 24 of Math/SRF_Math.php to 'return $this->getResultText($results, SMW_OUTPUT_HTML)' to get back the old behaviour. --Patrick Nagel 06:36, 5 July 2010 (UTC)

latest available version
Hi Yaron,

though 1.4.5 was officially released it is presently only possible to get older versions conveniently


 * MediaWiki Extensions downloader → latest available version is 1.4.3 (trunk switched off)
 * SourceForge → latest available version is 1.4.2
 * Semantic Bundle extension set → latest available version is 1.4.3

Is there anything that may be done to change this at least to 1.4.5? I just saw 1.5 might be ante portas soon. :-)

Cheers --kgh 17:05, 13 April 2010 (UTC)


 * The current version of Semantic Bundle includes SRF 1.4.5, doesn't it? Yaron Koren 20:16, 13 April 2010 (UTC)


 * You are right. Do not ask me how I came to think 1.4.3 was still included instead of 1.4.5. Thus I would like to apologise. However I hope my post was not entirely useless with regard to the other two sources. Cheers --kgh 20:48, 13 April 2010 (UTC)

SRF Pop UP
Has anyone one else has an issue with SRF producing a pop up ad? when ever I would got to a page that used SRF it would produce a pop up. At first I thought my security had been compromised but then narrowed it down to SRF. I commented out the call to SRF in my code and do not have the issue any more.

kpf 06/21/2010


 * What format(s) were you using? Yaron Koren 19:36, 21 June 2010 (UTC)


 * format=exhibit
 * views=map,tiles,tabular

I suppose it could be my local version of SRF although SRF seems to make some sort of contact with a computer at MIT.

kpf 06/21/2010 16:36 PDT


 * Ah - that's the 'exhibit' format, then. I don't know what the issue is there, but using the rest of SRF shouldn't cause problems. Yaron Koren 12:02, 22 June 2010 (UTC)