Picon

Appearance of Query Result -- External Links with text label

I’d like to display a text label with its associated external link as a property in the result of an #ask query. For example, I’d like to see Bernadette instead of  http://info.ldapserver.org /whatever/Bernadette.  I used the Tablerow and Homepage templates on the http://semanticweb.org/ site and was successful in duplicating the contact boxes but was not able to see the same information as part of an #ask. What am I missing? Also, we would really like to display the results of the parser extension ldapinfo as a property….We are using MediaWiki 1.13.2 and Semantic Mediawiki 1.3.

 

Thanks so much!

Bernadette

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Semediawiki-devel mailing list
Semediawiki-devel@...
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel
Izzy | 12 Nov 09:34
Picon

Writing an extension that outputs to a given format


I'm working closely with Guy Heathcote and we are loving what we can do with
our SMW. There has always been one thing that we couldn't do that involved a
simple query that output the results using a rather more complex set of
criteria - basically that the results are ordered according the a hierarchy
defined by a given property of a given category of page.

Having tried for a while to do this inline (spinning off lots of pages, etc)
I came to the conclusion that the only way to achieve what we wanted was to
write some form of extension. My PHP and O-O are both rudimentary. However,
I have a great sense of humour, so I set about this task last week.

Now I have my rough extension written, based on Semantic Calendar. I can get
the page names I want in the order i want. However, I can't figure out how
to output the results to the wiki page. 

I've had a good delve through the classes, and have concluded that the most
important thing is to supply SMWPrintRequest() with the right input
arguments and SMWQueryProcessor::createQuery() and
smwfGetStore()->getQueryResult() will return all the information that I
require. Is this right? 

However, I can't work out what the input arguments for SMWPrintRequest() are
(sorry!). Any hints would be really really welcome.

Cheers,
Izzy
--

-- 
View this message in context: http://www.nabble.com/Writing-an-extension-that-outputs-to-a-given-format-tp20438110p20438110.html
Sent from the Semantic Mediawiki - Development mailing list archive at Nabble.com.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
Jason Lawrence | 12 Nov 00:40

URI construction in SMW_Exporter and SMW_RAPStore2

Howdy

I'm a new user of SMW, and would love to assist with development however I can. Currently, I'm writing a simple extension to integrate (as a special page) the rdfapi-php netapi SPARQL endpoint. I've succeeded in configuring the netapi endpoint (and wouldn't mind working on some of the documentation regarding that). Additionally, my extension is working (though somewhat incomplete) and I'd love to make it available to the community soon.

I wanted to make note of two issues that effect my projects, and could potentially cause issues for others. The first involves the 'enableSemantics' function in SMW_GlobalFunctions.php when a full domain is provided, and how it effects the behavior of initBaseURIs in SMW_Exporter.php.

For example:

LocalSettings.php:
   enableSemantics('https://example.com/testwiki/index.php/', true);

When initBaseURIs is called, and the following block of code is processed:

                if (''==$smwgNamespace) {
                        $resolver = Title::makeTitle( NS_SPECIAL, 'URIResolver');
                        $smwgNamespace = $resolver->getFullURL() . '/';
                }
                if ($smwgNamespace[0] == '.') {
                        $resolver = Title::makeTitle( NS_SPECIAL, 'URIResolver');
                        $smwgNamespace = "http://" . substr($smwgNamespace, 1) . $resolver->getLocalURL() . '/';
                }

The condition in which $smwgNamespace represents a full domain is not handled at all. My workaround was to use the first if statement as an else block for the second if statement.

                if ($smwgNamespace[0] == '.') {
                        $resolver = Title::makeTitle( NS_SPECIAL, 'URIResolver');
                        $smwgNamespace = "http://" . substr($smwgNamespace, 1) . $resolver->getLocalURL() . '/';
                } else {
                        $resolver = Title::makeTitle( NS_SPECIAL, 'URIResolver');
                        $smwgNamespace = $resolver->getFullURL() . '/';
                }

This way, the Special:URIResolver segment is still appended properly.



My second issue was with the model and base URI creation mechanism in SMW_RAPStore2.php (and SMW_RAPStore.php). If you're running a wiki with a script path, shouldn't this be attached to the model/base URIs? (I'm new to the semantic web, so my apologies if this is a misunderstanding on my part)

To get what I wanted here (the script path appended to the URI), I made the following changes:

includes/storage/SMW_RAPStore2.php:

        public function SMWRAPStore2() {
                global $smwgRAPPath,$wgServer, $wgScriptPath; // <--  Added $wgScriptPath

                //  Modified uri building procedure to include script path.
                $this->modeluri = SMWExporter::expandURI($wgServer . $wgScriptPath . "/model");
                $this->baseuri  = SMWExporter::expandURI($wgServer . $wgScriptPath . "/id");
        }

This way http://example.com/wiki1 and http://example.com/wiki2 don't have the same model uri (which may be annoying even if they aren't sharing a RAP database).


Please let me know if anything I've mentioned here is asinine or does not belong on this mailing list.

Thanks,
Jason Lawrence

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Semediawiki-devel mailing list
Semediawiki-devel@...
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel
Daniel Werner | 9 Nov 14:26
Picon

Offer for a new Query format in SMW. Take a look at my Template!

Hi

Today I fixed a problem I had since a long time with SMW.
I never found a way to Query Properties from Page A and assign the same
property values to one of Page B's Property.

Now I installed the Semantic Forms extension to use the #arraymap parser
function to allow the user in over a template to assign more than one
property to a attribute in one step.
After that I wrote a template with which it's possible to convert a Query
output (format=list and links=none) into another string which is compatible
with the #arraymap parser function to assign it to a property of another
page.

The template code for my template "Query-Output assign property format" is:
<includeonly>{{#replace:{{#replace:  {{#regex: {{{1|}}}|/,(?=[^()]*\))/|;}}
|(|;}} |)|}}</includeonly> (You need the extensions "RegexParserFunctions"
and "StringFunctions" for that)

What does it?
For example you use it as:
"{{Querry-Output assign property format | Daniel (2, 3, 4), Alex (4,
nothing, something), Harry (29, what?, 2200) }}"
You will get the result:
"Daniel ;2; 3; 4, Alex ;4; nothing; something, Harry ;29; what?; 2200"

As you see, this is a string which you can assign with help of #arraymap
function or another template to every property and page you want to.
For sure it's also possible to use the template with a query like:

{{ Query-Output assign property format | {{#show: Pagename  |?Property name
|link=none  |format=list}} }}

So, it's very helpful if you want to use the same values for a property on
one page than on a target page. And that's all the time, also when the
properties on the target page changed!!

My offer is, to include something like that directly into
Semantic-MediaWiki. For example as a new query format which will create an
output like mine or directly something like [[property::value1;1;2;3]],
[[property::value2;1;2;3]], [[property::value3;1;2;3]] and so on...
That would be much more comfortable because it's not dependent on how the
list format will print out its results. The name of the new Query format
could be "property-assign" or simply "assign" for example. I really would
appreciate that :-)

Thanks for reading this!
Daniel Werner

__________ Information from ESET Smart Security, version of virus signature
database 2740 (20071221) __________

The message was checked by ESET Smart Security.

http://www.eset.com

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
Temlakos | 8 Nov 22:47
Picon

Non-linear data type query processing

Gentlemen:

This might seem a strange request, but I think about it every time I 
write a query (with #ask and now with #show) with a non-linear data 
type, either Temperature or my new Historical Date.

I would like to be able to specify, in the query, which unit (as kelvins 
or degrees Celsius, Fahrenheit, or Rankine) or which calendar (as 
Gregorian, Hillel, or AM) should display in query output. For example, 
say I wanted to write a biographical article on David ben-Gurion. Now as 
it stands, I can /annotate/ his dates of birth and death (or any other 
event in his life) in the Hillel II calendar. But if I write a query, 
I'm going to get it in the Gregorian calendar, and I'm pretty much stuck 
with that.

How do I enable my custom script (SMW_DV_HxDate.php) to support 
specified calendar formats for query processing?

What output does the query processor even ask for? I think it's 
ShortWikiText, because I get the tooltip dialog balloon.

But how do I get the baseline value to display according to a calendar 
other than the Julio-Gregorian calendar (that is, BC/AD)? In short, how 
do I get this:

{{#show: David ben Gurion|?Born#H}}

to display "17 Tishrei 5647" instead of "16 October 1886"?

Or how would I get

{{#show: Exodus of Israel|?Date#AM}}

to display "15 Abib 2513 AM" instead of "12 April 1491 BC"?

I would welcome any assistance.

Temlakos

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
Daniel Werner | 7 Nov 22:24
Picon

Re: Semantic Layers 0.4b2 near release

Hi,

There are still no Semantic Layers 0.4 available on you page :-( Do you have
any problems with it, or no time to test it and write the documentation?
I hope you will be able to release it soon :-)

Daniel 

> -----Original Message-----
> From: Matt Williamson [mailto:matthewdw <at> gm...]
> Sent: Friday, August 29, 2008 4:41 PM
> To: 'semediawiki-devel@...';
> Subject: [SMW-devel] Semantic Layers 0.4b2 near release
>
> Hi all,
>
> Semantic Layers 0.4b2 is almost ready to be released, bringing with it a
> whole slew of cool improvements. I think just about all the coding is
done,
> I just need to update the docs and make a new tarball when I have some
> time--unfortunately I have to do some other things today.
>
> In the meantime, I would be most appreciative if anybody who has some free
> time and is interested to check it out, poke around and see if anything
> breaks, or if you have any suggestions for improvement. The demo wiki is
at
> http://s89238293.onlinehome.us/w/ . Thanks again for everyone's help so
> far, especially Markus and Yaron!
> 
> In case people don't know (or have forgotten since I disappeared for a
> while :-) ), Semantic Layers turns your SMW wiki into a GIS-enabled wiki,
> with in-page maps, georeferencing and geoaggregation tools, and more
> recently, KML export of your wiki-geodata. It also can be used for non
> geographic applications such as image annotation and pseudo- geographic
> maps (e.g. for video games).
>
> -Matt

__________ Information from ESET Smart Security, version of virus signature
database 2740 (20071221) __________

The message was checked by ESET Smart Security.

http://www.eset.com

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
Nahid | 29 Oct 20:07
Picon
Favicon

Re: problem deleting a page manually


Hi, I'm creating extensions over mediawiki. I can't understand to work flow
of semantic-mediawik extension.

If you delete an article it drops the article from page table and the
smw_relation table also adjusted. (eg. it drops all DB column where
delete_article is_a another_article). But I've done the same code by my self
but smw_relation not table adjusted in my case.

Can anyone tell me how semantic-mediawik extension knows that an article is
deleted so it needs to adjust smw_relation table?
Thanks
Regards
-Nahid

--

-- 
View this message in context: http://www.nabble.com/problem-deleting-a-page-manually-tp20233035p20233822.html
Sent from the Semantic Mediawiki - Development mailing list archive at Nabble.com.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
quievryn | 29 Oct 04:48
Picon

Inline Query Question

I'm not the most advanced at Semantic programming, so I'm hoping one or 
two of the mailing list gurus can help me with one question.

On an inline query, is it possible to create a condition that if a 
number (say a program was running from 1 - 13) and answers are returned 
for say all but 11, to instead replace 11 with a bar (I already have 
the bar designed).

Here is a look at an example:

http://thirdturn.wikia.com/wiki/Martin_Rosler/Results/Northwest_Tour/1991

I would like to use my "Skip" bar be able to be inserted between entry 
#2 and entry #4 so users don't strain to try to find the discontinuity. 
So, in the query template, can I make it so that if say n1 is not equal 
to n0 + 1, then to insert the bar?

Here is a look at my query template:

http:/thirdturn.wikia.com/wiki/Template:ResultForm

Thanks
Tim Quievryn

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
Markus Krötzsch | 26 Oct 18:08

SMW 1.4 alpha version for extension developers

Dear SMW (extension) developers,

SMW 1.4 brings a number of internal API changes that will require most 
extensions to change details in their code. In most cases, it will suffice to 
change the name of some class or function slightly, and some special parts of 
code might become obsolete. This can be seen already on SVN (and on the online 
API docs), but for your convenience, we have now also released an alpha 
version that is in a working state (hopefully) and that includes most changes 
that we intend for SMW 1.4. Quoting from semantic-mediawiki.org:

"Oct 26 2008. Version 1.4 of Semantic MediaWiki will largely unify the 
treatment of "special properties" (like has type) and normal user-defined 
properties. Both can be queried in essentially the same ways, and new 
"special" properties will be introduced to allow new features. Together with 
other required clean-ups, this brings some changes for developers using SMW 
for their own extensions. To help extension developers in producing compatible 
updates for their software, the SMW Project releases an alpha version of SMW 
1.4 which already includes all major internal API modifications. While many 
details changed their appearance, upgrading code to SMW 1.4 should in many 
cases boil down to some search and replace of small code pieces. Details will 
be discussed on the developer mailing list

* Download: http://semantic-mediawiki.org/w/images/semediawiki-1.4d-
alpha.tar.gz 

Users are also invited to test the alpha version, but it is not recommended to 
use it on production sites yet. In particular, extensions for SMW 1.3 will 
most likely not work with SMW 1.4 without changes."

The main change is that all properties are now represented by objects of a 
class SMWPropertyValue (see its online API doc), and no longer using Title 
objects and numbers (for special properties). In most cases, you do not longer 
distinguish between "special" and normal properties, but the SMWPropertyValue 
has functions to ask whether the property is one that should be shown to users 
or not (e.g. if it is internal and has no label at all). This is the main 
change, and it affects essentially all functions of SMW that take properties 
as arguments. It is usually easy to fix the type errors that you will get when 
using these functions with the old parameters. Some functions have also simply 
vanished (all with "special" in their name are just obsolete). 

In addition, the interface of SMWDataValue has changed slightly, since it uses 
the new property objects as well. In addition, some features that are really 
belonging to properties (getting a properties type) have moved to the new 
property class.

As a bonus, SMW 1.4 offers new hooks that allow you to:
* Add your own pre-defined ("special") properties in PHP, e.g. to have a pre-
declared property or your extesnsion (see SMWPropertyValue for this hook).
* Modify the Factbox layout as you like, using your own code to format the 
output (see SMWFactbox for this hook).

Feel free to ask questions if you want more details on some new design or on 
some required change. Otherwise it is probably also helpful to look at SMW 
code using the new methods, especially compared to SMW 1.3 code.

Cheers,

Markus

--

-- 
Markus Krötzsch
Semantic MediaWiki    http://semantic-mediawiki.org
http://korrekt.org    markus@...

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Semediawiki-devel mailing list
Semediawiki-devel@...
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel
Yaron Koren | 23 Oct 22:56
Picon

'calendar' format added to Semantic Result Formats

Hi,

I just added code to handle a 'calendar' format in Semantic Result Formats. This is essentially the code from the Semantic Calendar extension, although that one uses/used its own parser function, #semantic_calendar, while this one uses #ask. Included in this addition was the creation of an internationalization file for SRF, which currently just holds the language values from Semantic Calendar.

This is a very "soft" release - I'm only sending this to the developers list for now. I want to make sure that everything looks good, in terms of the code layout - I believe 'calendar' is the first format that uses more than one PHP file, so I had to come up with some new conventions. If you see something that you think should be changed, you can respond to this email, or feel free to just change it yourself. You can also try out the new format - it basically works as you could imagine. You just need to make sure that one of the properties being displayed is of type 'Date', and most likely you'll want to add in a "limit=" parameter to the #ask query, to increase the number of values being 'displayed' above 50, since within the calenda r all the results get 'displayed' at once.

This marks the beginning of the deprecation of the Semantic Calendar extension, although it may take a while until it's officially deprecated - perhaps when SMW 1.4 is released.

-Yaron

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Semediawiki-devel mailing list
Semediawiki-devel@...
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel
Yaron Koren | 23 Oct 18:10
Picon

Problem with new date parsing in SMW

Hi,

I'm testing out the current SMW 1.4 code in SVN; so far everything seems to be working fine, except for a problem with date parsing. The system now rejects dates of the form "January 1, 2008"; though it accepts "January 1 2008", without the comma. The former, though, is much more common in the American date format, and in fact it's what Semantic Forms' date input produces, when the wiki has $wgAmericanDates set to true. Can this be fixed?

Thanks,
Yaron

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Semediawiki-devel mailing list
Semediawiki-devel@...
https://lists.sourceforge.net/lists/listinfo/semediawiki-devel

Gmane