Quantcast

ask subobject property

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

ask subobject property

Christian Wagner
Hello everyone!

How can I use #ask to get the value of a subobject?

Example from:
https://www.mediawiki.org/wiki/Extension:Page_Forms/Quick_start_guide
Let's say that I want to create a wiki that shows all the books I have
at home. I have two kinds of pages on my wiki: one for books, and one
for authors. Each book page holds a title, an author name, a genre, a
year of publication, and a number of pages. Additionally, there is a
subobject to hold links to sites were the book is promoted. Each author
page holds the author name and their country of origin.

For each author I want do show all the available kooks with all their
values.
To do that I add a inline query to my author template:

{{#ask:
    [[Category:Books]]
    [[Was written by::{{SUBJECTPAGENAME}}]]
    |?Has genre
    |?Was published in year
    |?Has number of pages
}}

What do I have to add to also get the values of the subobject?


Thank you in advance!

Christian Wagner


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: ask subobject property

James HK
Hi,

> How can I use #ask to get the value of a subobject?

Personally, I don't use the forms extension therefore I cannot tell
you how this fits together with [0, 1] but hopefully it can answer
your question.

There are different ways on how to model book/author entities with or
without using subobjects. [0] contains one example on how a subobject
can represent a book entity. Feel free to use the sandbox and adjust
the given examples.

[0] https://sandbox.semantic-mediawiki.org/wiki/Herman_Melville
[1] https://sandbox.semantic-mediawiki.org/wiki/BookAuthorSampleQuery

[2] https://www.semantic-mediawiki.org/wiki/Help:Subobjects_and_queries

Cheers

On 3/17/17, Christian Wagner <[hidden email]> wrote:

> Hello everyone!
>
> How can I use #ask to get the value of a subobject?
>
> Example from:
> https://www.mediawiki.org/wiki/Extension:Page_Forms/Quick_start_guide
> Let's say that I want to create a wiki that shows all the books I have
> at home. I have two kinds of pages on my wiki: one for books, and one
> for authors. Each book page holds a title, an author name, a genre, a
> year of publication, and a number of pages. Additionally, there is a
> subobject to hold links to sites were the book is promoted. Each author
> page holds the author name and their country of origin.
>
> For each author I want do show all the available kooks with all their
> values.
> To do that I add a inline query to my author template:
>
> {{#ask:
>     [[Category:Books]]
>     [[Was written by::{{SUBJECTPAGENAME}}]]
>     |?Has genre
>     |?Was published in year
>     |?Has number of pages
> }}
>
> What do I have to add to also get the values of the subobject?
>
>
> Thank you in advance!
>
> Christian Wagner
>
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Semediawiki-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: ask subobject property

Christian Wagner
Hi,

thank you for your hints and preparations.
I've added another book [1] with subobjects. In these subobjects I've
added a property called 'Has ReprintYear'. Can you please help me to
alter the queries in [2] and [3] to also get the values from the
property 'Has ReprintYear'?


[1] https://sandbox.semantic-mediawiki.org/wiki/Billy_Budd
[2] https://sandbox.semantic-mediawiki.org/wiki/Herman_Melville
[3] https://sandbox.semantic-mediawiki.org/wiki/BookAuthorSampleQuery


Thank you in advance!

Christian Wagner




Am 18.03.17 um 12:33 schrieb James HK:

> Hi,
>
>> How can I use #ask to get the value of a subobject?
> Personally, I don't use the forms extension therefore I cannot tell
> you how this fits together with [0, 1] but hopefully it can answer
> your question.
>
> There are different ways on how to model book/author entities with or
> without using subobjects. [0] contains one example on how a subobject
> can represent a book entity. Feel free to use the sandbox and adjust
> the given examples.
>
> [0] https://sandbox.semantic-mediawiki.org/wiki/Herman_Melville
> [1] https://sandbox.semantic-mediawiki.org/wiki/BookAuthorSampleQuery
>
> [2] https://www.semantic-mediawiki.org/wiki/Help:Subobjects_and_queries
>
> Cheers
>
> On 3/17/17, Christian Wagner <[hidden email]> wrote:
>> Hello everyone!
>>
>> How can I use #ask to get the value of a subobject?
>>
>> Example from:
>> https://www.mediawiki.org/wiki/Extension:Page_Forms/Quick_start_guide
>> Let's say that I want to create a wiki that shows all the books I have
>> at home. I have two kinds of pages on my wiki: one for books, and one
>> for authors. Each book page holds a title, an author name, a genre, a
>> year of publication, and a number of pages. Additionally, there is a
>> subobject to hold links to sites were the book is promoted. Each author
>> page holds the author name and their country of origin.
>>
>> For each author I want do show all the available kooks with all their
>> values.
>> To do that I add a inline query to my author template:
>>
>> {{#ask:
>>      [[Category:Books]]
>>      [[Was written by::{{SUBJECTPAGENAME}}]]
>>      |?Has genre
>>      |?Was published in year
>>      |?Has number of pages
>> }}
>>
>> What do I have to add to also get the values of the subobject?
>>
>>
>> Thank you in advance!
>>
>> Christian Wagner
>>
>>
>> ------------------------------------------------------------------------------
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>> _______________________________________________
>> Semediawiki-user mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>>


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user
Loading...