Re: [SMW-devel] Any chance to get special properties to the factbox?

2013-02-23 Thread Markus Krötzsch
On 23/02/13 17:36, Lists wrote:
> Hello Markus and the others,
>
>
> we are doing this in a "SMWStore::updateDataBefore" - handler. The property
> shows up in the browse function not in the "normal" article view. If this
> isn't functional how can we alter an existing property value with this
> handler?
> Let's say we have a property called "Edited by". This property should have
> the value (string) "Hans Bot" which would be set programatically in an
> "SMWStore::updateDataBefore - handler" while saving an article. How to
> archieve this?

Properties that should appear in the Factbox need to be added during 
parsing, so you would have to use another MediaWiki hook that is 
triggered during parsing. The SMWStore hook is called only when the page 
is saved, so it does not happen at all on preview, so it cannot have any 
effect on the Factbox. There are many MW hooks that run during parsing, 
but we do not have a standard pattern or example code for hacking into 
the system at this point, I think. You can have a look at the SMW code 
if you like (SMWParseData implements the main methods used to store data 
during parsing; most importantly, you can get the SMWSemanticData object 
during parsing by calling SMWParseData::getSMWData( $parser ); if you 
store data in there during parsing then it should appear in the Factbox).

Cheers,

Markus

>
> For now we have this for a special/meta property which doesn't fits:
>
>//Edited by
>  $revision = Revision::newFromTitle($title);
>  $user = User::newFromId($revision->getUser());
>  if(($user->isAnon()==false)&&($wgCommandLineMode==false))://bug es
> wird trotzdem geadded bei SMW_refreshData.php
>  $dataItem = SMWDIWikiPage::newFromTitle($user->getUserPage());
>  $property = new SMWDIProperty('___SDWED');
>  if(!is_null($dataItem)):
>  $data->addPropertyObjectValue($property, $dataItem);
>  endif;
>  endif;
>
>
>> The Factbox is populated while parsing the page. Every meta property that
> is added at this time will appear in the Factbox. As a matter of >principle,
> meta properties that are not known yet when building the page cannot be
> shown in the Factbox (simple way to judge this: is the >property already
> known when creating an edit preview?).
>
>> If a property is added in time and still does not appear in the Factbox, it
> might be that its display is disabled. This is defined when >registering new
> properties. One can also check if the property is shown in Special:Browse
> (if not, then it may be invisible; maybe it does >not even have a
> user-readable label).
>
>> Cheers
>
>> Markus
>
> 
> 
> Hello SMW community,
>
>
> I know it is sometimes a little bit hard to get response from this list. But
> I will try it again with a longer description.
> We are working with SMW and MW, contributed extensions to MW since several
> years now and want to develope some special SMW-based MW-extensions. We are
> not able to visit SMW-Conferences- so we only can reach the currently
> published mailinglists, documentations and videos.
>
> Thanks to the extension "Semantic Extra Special Properties" it is now
> transparent how to create properties with PHP for the first time by a simple
> and god to use example code. We also managed to read, delete properties and
> add cumulative values to a property (maybe the wrong way). To get a little
> bit progress in this CRUD-related cases I want to aks the following
> questions in the hope someone can provide anwers/resources. I post no code
> here because my last mail was truncated and trashed ;-).
>
> 1. Unfortunately we did not succeed in using the SMWWriter extension. Is
> this project still maintained. Did someone used it with MW 1.20.x and SMW
> 1.8.x?
>
> 2. When we are dealing with PHP-driven properties, we always produce special
> properties. How can we create and manipulate properties related to userland
> in PHP?
>
> 2.1 How can we avoid doubling of values in a string typed property?
>
> 2.2 How can we influence the display of PHP-generated properties in the
> factbox?
>
> 3. Instead of the SF-API we want to use our already established MW-API
> interface and poor PHP. Are there any additional resources how to manage
> this CRUD-things...create, read, update, delete semantic properties on an
> "official standard way" so that we can maintain our developments along this
> official standards in the long term?
>
> best regards and thank you for your help
>
> Steve
>
>
> --
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_feb
> ___
> Semediawiki-devel mailing list
> S

Re: [SMW-devel] Any chance to get special properties to the factbox?

2013-02-23 Thread Lists
Hello Markus and the others,


we are doing this in a "SMWStore::updateDataBefore" - handler. The property
shows up in the browse function not in the "normal" article view. If this
isn't functional how can we alter an existing property value with this
handler?
Let's say we have a property called "Edited by". This property should have
the value (string) "Hans Bot" which would be set programatically in an
"SMWStore::updateDataBefore - handler" while saving an article. How to
archieve this?

For now we have this for a special/meta property which doesn't fits:

  //Edited by
$revision = Revision::newFromTitle($title);
$user = User::newFromId($revision->getUser());
if(($user->isAnon()==false)&&($wgCommandLineMode==false))://bug es
wird trotzdem geadded bei SMW_refreshData.php
$dataItem = SMWDIWikiPage::newFromTitle($user->getUserPage());
$property = new SMWDIProperty('___SDWED');
if(!is_null($dataItem)):
$data->addPropertyObjectValue($property, $dataItem);
endif;
endif;


>The Factbox is populated while parsing the page. Every meta property that
is added at this time will appear in the Factbox. As a matter of >principle,
meta properties that are not known yet when building the page cannot be
shown in the Factbox (simple way to judge this: is the >property already
known when creating an edit preview?).

>If a property is added in time and still does not appear in the Factbox, it
might be that its display is disabled. This is defined when >registering new
properties. One can also check if the property is shown in Special:Browse
(if not, then it may be invisible; maybe it does >not even have a
user-readable label).

>Cheers

>Markus



Hello SMW community,


I know it is sometimes a little bit hard to get response from this list. But
I will try it again with a longer description.
We are working with SMW and MW, contributed extensions to MW since several
years now and want to develope some special SMW-based MW-extensions. We are
not able to visit SMW-Conferences- so we only can reach the currently
published mailinglists, documentations and videos. 

Thanks to the extension "Semantic Extra Special Properties" it is now
transparent how to create properties with PHP for the first time by a simple
and god to use example code. We also managed to read, delete properties and
add cumulative values to a property (maybe the wrong way). To get a little
bit progress in this CRUD-related cases I want to aks the following
questions in the hope someone can provide anwers/resources. I post no code
here because my last mail was truncated and trashed ;-).

1. Unfortunately we did not succeed in using the SMWWriter extension. Is
this project still maintained. Did someone used it with MW 1.20.x and SMW
1.8.x?

2. When we are dealing with PHP-driven properties, we always produce special
properties. How can we create and manipulate properties related to userland
in PHP?

2.1 How can we avoid doubling of values in a string typed property?

2.2 How can we influence the display of PHP-generated properties in the
factbox?

3. Instead of the SF-API we want to use our already established MW-API
interface and poor PHP. Are there any additional resources how to manage
this CRUD-things...create, read, update, delete semantic properties on an
"official standard way" so that we can maintain our developments along this
official standards in the long term?

best regards and thank you for your help

Steve


--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


[SMW-devel] Text is the new String

2013-02-23 Thread Markus Krötzsch
Dear developers,

change https://gerrit.wikimedia.org/r/50488 merges the String and Text 
datatypes on all levels (user labels, datatype ids, PHP objects). This 
means the following for your future code:

* Use SMWDIBlob instead of SMWDIString
* Use '_txt' instead of '_str'

For SMW 1.9, '_str' and SMWDIString remain functional as aliases for 
'_txt' and SMWDIBlob, but this will have to end at some point. So code 
should gradually be updated to replace the old identifiers. No interface 
changes, so it is really just a search & replace activity.

Cheers,

Markus

--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


Re: [SMW-devel] Any chance to get special properties to the factbox?

2013-02-23 Thread Markus Krötzsch
On 20/02/13 14:09, Lists wrote:
>
> Hello,
>
> is there any chance to get special properties (meta) into the factbox?

The Factbox is populated while parsing the page. Every meta property 
that is added at this time will appear in the Factbox. As a matter of 
principle, meta properties that are not known yet when building the page 
cannot be shown in the Factbox (simple way to judge this: is the 
property already known when creating an edit preview?).

If a property is added in time and still does not appear in the Factbox, 
it might be that its display is disabled. This is defined when 
registering new properties. One can also check if the property is shown 
in Special:Browse (if not, then it may be invisible; maybe it does not 
even have a user-readable label).

Cheers

Markus


--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel


[SMW-devel] SMWSQLStore2 support will be dropped

2013-02-23 Thread Markus Krötzsch
Dear all,

this email is to confirm that the old database management code 
"SQLStore2" (which was superseded by "SQLStore3" in SMW 1.8) will be 
dropped in future SMW versions. This has been on our public roadmap for 
some time -- I am just sending this to make everyone aware of this to 
avoid surprises.

This only affects you if you run a wiki that uses SMW 1.7 or older, or 
if you use one of the following lines in its LocalSettings:

$smwgDefaultStore = 'SMWSQLStore2';
SMWSparqlStore::$baseStoreClass = 'SMWSQLStore2';

If this is the case for you, you will need to remove the above lines 
when upgrading SMW, run the setup again (like on normal installation), 
and refresh the data as explained in the documentation.

Dropping the old code will allow us to implement a number of 
improvements in SMW that would not work with the old code. Most notably 
the String and Text datatypes will become the same.

Cheers,

Markus

--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
___
Semediawiki-devel mailing list
Semediawiki-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel