Feeling lost with subobjects

classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

Feeling lost with subobjects

Josh King
Hi all,

I'm attempting to allow my users to take advantage of multiple instance
sections on a form, but I can't seem to wrap my head around getting the
subobject data associated with the page the form creates.

As I understand, the subobject is like it's own page and you can't manually
define that a page has a subobject-- if this is so, how can that page be
associated with the semantic data in the subobject?

Right now, my master form embeds the subobject multiple-instance template
in one of it's fields, but I'm not quite sure where exactly this ends up
passing the information along to.

Thanks!
Josh
------------------------------------------------------------------------------
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user
Reply | Threaded
Open this post in threaded view
|

Re: Feeling lost with subobjects

Josh King
Update:
I think I understand this slightly better now (in the least my inline query
to show the subobjects work). By calling my subobject template within my
page, the page now accurately has the special "Has subobject" property to
associate it to the subobject.

My question though now is still where is that subobject data stored?

If I have multiple pages all using the same subobject template (with the
subobject given some typed out identifier), is the actual data for all
those pages going into that same subobject (as I understand subobjects are
like invisible pages), or are multiple instances of that subobject being
created? For that matter, how could I even see which subobjects exist on my
wiki and delete them if needed?

My major concern though is that if all that data is just going to one
place, then that would quickly get bogged down as my number of pages using
it increased.

On Sat, Oct 24, 2015 at 2:40 PM, Josh King <[hidden email]> wrote:

> Hi all,
>
> I'm attempting to allow my users to take advantage of multiple instance
> sections on a form, but I can't seem to wrap my head around getting the
> subobject data associated with the page the form creates.
>
> As I understand, the subobject is like it's own page and you can't
> manually define that a page has a subobject-- if this is so, how can that
> page be associated with the semantic data in the subobject?
>
> Right now, my master form embeds the subobject multiple-instance template
> in one of it's fields, but I'm not quite sure where exactly this ends up
> passing the information along to.
>
> Thanks!
> Josh
>
------------------------------------------------------------------------------
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user
Reply | Threaded
Open this post in threaded view
|

Re: Feeling lost with subobjects

James HK
Hi,

> If I have multiple pages all using the same subobject template (with the
> subobject given some typed out identifier), is the actual data for all
> those pages going into that same subobject (as I understand subobjects are

No.

> those pages going into that same subobject (as I understand subobjects are
> like invisible pages), or are multiple instances of that subobject being
> created? For that matter, how could I even see which subobjects exist on my

Each subobject is associated with a "root" subject (a subject that
embeds a subobject). Aside from this association, a subobject is
encoded by a name that corresponds to the data its represents and is
addressed internally via SUBJECT#NS#IW#SUBOBJECTNAME.

If two subobjects describe the same thing (we assume they denote a
thing with the same data) within the same subject then only one
subobject is stored. [0].

If two subobjects appear to describe the same thing but are embedded
in two different subjects then those subobjects (in connection with
the subject) represent two totally different things therefore are
stored separately and distinct from each other.

Subject FOO with
{{#subobject:
 |Has number=123
}}

is different from

Subject BAR with
{{#subobject:
 |Has number=123
}}

A question such as "Which subject contains [[Has number::123]]" will
be answered by:

- FOO#_c869667efa584ce62a07d13723321630
- BAR#_c869667efa584ce62a07d13723321630

> My major concern though is that if all that data is just going to one
> place, then that would quickly get bogged down as my number of pages using
> it increased.

Each subject (and each subobject) is stored as single row[1] in the DB
(depending on above conditions).

> created? For that matter, how could I even see which subobjects exist on my
> wiki and delete them if needed?

Via `Special:Browse` or as list displayed in `Property:Has subobject`.

If a subject (== article or page) is deleted all associated subobjects
are deleted as well. If you want to remove a specific subobject then
you have the remove that particular #subobject call from your subject.

[0] https://semantic-mediawiki.org/wiki/Help:Adding_subobjects#Conceptional_notes

[1] This statement is a simplification but should help to clarify the
issue raised.

Cheers

On 10/24/15, Josh King <[hidden email]> wrote:

> Update:
> I think I understand this slightly better now (in the least my inline query
> to show the subobjects work). By calling my subobject template within my
> page, the page now accurately has the special "Has subobject" property to
> associate it to the subobject.
>
> My question though now is still where is that subobject data stored?
>
> If I have multiple pages all using the same subobject template (with the
> subobject given some typed out identifier), is the actual data for all
> those pages going into that same subobject (as I understand subobjects are
> like invisible pages), or are multiple instances of that subobject being
> created? For that matter, how could I even see which subobjects exist on my
> wiki and delete them if needed?
>
> My major concern though is that if all that data is just going to one
> place, then that would quickly get bogged down as my number of pages using
> it increased.
>
> On Sat, Oct 24, 2015 at 2:40 PM, Josh King <[hidden email]> wrote:
>
>> Hi all,
>>
>> I'm attempting to allow my users to take advantage of multiple instance
>> sections on a form, but I can't seem to wrap my head around getting the
>> subobject data associated with the page the form creates.
>>
>> As I understand, the subobject is like it's own page and you can't
>> manually define that a page has a subobject-- if this is so, how can that
>> page be associated with the semantic data in the subobject?
>>
>> Right now, my master form embeds the subobject multiple-instance template
>> in one of it's fields, but I'm not quite sure where exactly this ends up
>> passing the information along to.
>>
>> Thanks!
>> Josh
>>
> ------------------------------------------------------------------------------
> _______________________________________________
> Semediawiki-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>

------------------------------------------------------------------------------
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user
Reply | Threaded
Open this post in threaded view
|

Re: Feeling lost with subobjects

Josh King
Thank you James-- I had begun to think that I needed the anonymous
identifiers for my subobjects so that multiple pages wouldn't bloat them,
but now that I understand that subobjects really are stored within a
subject (instead of floating sneakily in the nether), this all makes much
more sense and I'll stick with my named identifiers. That solved all my
questions so thanks again!

-Josh

On Sat, Oct 24, 2015 at 6:46 PM, James HK <[hidden email]>
wrote:

> Hi,
>
> > If I have multiple pages all using the same subobject template (with the
> > subobject given some typed out identifier), is the actual data for all
> > those pages going into that same subobject (as I understand subobjects
> are
>
> No.
>
> > those pages going into that same subobject (as I understand subobjects
> are
> > like invisible pages), or are multiple instances of that subobject being
> > created? For that matter, how could I even see which subobjects exist on
> my
>
> Each subobject is associated with a "root" subject (a subject that
> embeds a subobject). Aside from this association, a subobject is
> encoded by a name that corresponds to the data its represents and is
> addressed internally via SUBJECT#NS#IW#SUBOBJECTNAME.
>
> If two subobjects describe the same thing (we assume they denote a
> thing with the same data) within the same subject then only one
> subobject is stored. [0].
>
> If two subobjects appear to describe the same thing but are embedded
> in two different subjects then those subobjects (in connection with
> the subject) represent two totally different things therefore are
> stored separately and distinct from each other.
>
> Subject FOO with
> {{#subobject:
>  |Has number=123
> }}
>
> is different from
>
> Subject BAR with
> {{#subobject:
>  |Has number=123
> }}
>
> A question such as "Which subject contains [[Has number::123]]" will
> be answered by:
>
> - FOO#_c869667efa584ce62a07d13723321630
> - BAR#_c869667efa584ce62a07d13723321630
>
> > My major concern though is that if all that data is just going to one
> > place, then that would quickly get bogged down as my number of pages
> using
> > it increased.
>
> Each subject (and each subobject) is stored as single row[1] in the DB
> (depending on above conditions).
>
> > created? For that matter, how could I even see which subobjects exist on
> my
> > wiki and delete them if needed?
>
> Via `Special:Browse` or as list displayed in `Property:Has subobject`.
>
> If a subject (== article or page) is deleted all associated subobjects
> are deleted as well. If you want to remove a specific subobject then
> you have the remove that particular #subobject call from your subject.
>
> [0]
> https://semantic-mediawiki.org/wiki/Help:Adding_subobjects#Conceptional_notes
>
> [1] This statement is a simplification but should help to clarify the
> issue raised.
>
> Cheers
>
> On 10/24/15, Josh King <[hidden email]> wrote:
> > Update:
> > I think I understand this slightly better now (in the least my inline
> query
> > to show the subobjects work). By calling my subobject template within my
> > page, the page now accurately has the special "Has subobject" property to
> > associate it to the subobject.
> >
> > My question though now is still where is that subobject data stored?
> >
> > If I have multiple pages all using the same subobject template (with the
> > subobject given some typed out identifier), is the actual data for all
> > those pages going into that same subobject (as I understand subobjects
> are
> > like invisible pages), or are multiple instances of that subobject being
> > created? For that matter, how could I even see which subobjects exist on
> my
> > wiki and delete them if needed?
> >
> > My major concern though is that if all that data is just going to one
> > place, then that would quickly get bogged down as my number of pages
> using
> > it increased.
> >
> > On Sat, Oct 24, 2015 at 2:40 PM, Josh King <[hidden email]> wrote:
> >
> >> Hi all,
> >>
> >> I'm attempting to allow my users to take advantage of multiple instance
> >> sections on a form, but I can't seem to wrap my head around getting the
> >> subobject data associated with the page the form creates.
> >>
> >> As I understand, the subobject is like it's own page and you can't
> >> manually define that a page has a subobject-- if this is so, how can
> that
> >> page be associated with the semantic data in the subobject?
> >>
> >> Right now, my master form embeds the subobject multiple-instance
> template
> >> in one of it's fields, but I'm not quite sure where exactly this ends up
> >> passing the information along to.
> >>
> >> Thanks!
> >> Josh
> >>
> >
> ------------------------------------------------------------------------------
> > _______________________________________________
> > Semediawiki-user mailing list
> > [hidden email]
> > https://lists.sourceforge.net/lists/listinfo/semediawiki-user
> >
>
------------------------------------------------------------------------------
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user
Reply | Threaded
Open this post in threaded view
|

Re: Feeling lost with subobjects

Fannon
I'm not sure whether this is best practice, but I ended up adding two
helper properties to each subobject I'm using.

Something like:

{{#subobject:
 |Superobject:__FULLPAGENAME__​
 |SubobjectType: NameOfTheMultipleInstanceTemplate
 |Has number=123
}}

This allows you to write your queries for subobjects in a much more natural
way:

[[Superobject:Page A]][[SubobjectType:TemplA]] |?Has number

Of course, you could replace the Superobject with an inverse property. The
SubobjectType I find very useful, since you can clearly define to only
query for those subobject types.

Best,
Simon

2015-10-25 3:21 GMT+01:00 Josh King <[hidden email]>:

> Thank you James-- I had begun to think that I needed the anonymous
> identifiers for my subobjects so that multiple pages wouldn't bloat them,
> but now that I understand that subobjects really are stored within a
> subject (instead of floating sneakily in the nether), this all makes much
> more sense and I'll stick with my named identifiers. That solved all my
> questions so thanks again!
>
> -Josh
>
> On Sat, Oct 24, 2015 at 6:46 PM, James HK <[hidden email]>
> wrote:
>
> > Hi,
> >
> > > If I have multiple pages all using the same subobject template (with
> the
> > > subobject given some typed out identifier), is the actual data for all
> > > those pages going into that same subobject (as I understand subobjects
> > are
> >
> > No.
> >
> > > those pages going into that same subobject (as I understand subobjects
> > are
> > > like invisible pages), or are multiple instances of that subobject
> being
> > > created? For that matter, how could I even see which subobjects exist
> on
> > my
> >
> > Each subobject is associated with a "root" subject (a subject that
> > embeds a subobject). Aside from this association, a subobject is
> > encoded by a name that corresponds to the data its represents and is
> > addressed internally via SUBJECT#NS#IW#SUBOBJECTNAME.
> >
> > If two subobjects describe the same thing (we assume they denote a
> > thing with the same data) within the same subject then only one
> > subobject is stored. [0].
> >
> > If two subobjects appear to describe the same thing but are embedded
> > in two different subjects then those subobjects (in connection with
> > the subject) represent two totally different things therefore are
> > stored separately and distinct from each other.
> >
> > Subject FOO with
> > {{#subobject:
> >  |Has number=123
> > }}
> >
> > is different from
> >
> > Subject BAR with
> > {{#subobject:
> >  |Has number=123
> > }}
> >
> > A question such as "Which subject contains [[Has number::123]]" will
> > be answered by:
> >
> > - FOO#_c869667efa584ce62a07d13723321630
> > - BAR#_c869667efa584ce62a07d13723321630
> >
> > > My major concern though is that if all that data is just going to one
> > > place, then that would quickly get bogged down as my number of pages
> > using
> > > it increased.
> >
> > Each subject (and each subobject) is stored as single row[1] in the DB
> > (depending on above conditions).
> >
> > > created? For that matter, how could I even see which subobjects exist
> on
> > my
> > > wiki and delete them if needed?
> >
> > Via `Special:Browse` or as list displayed in `Property:Has subobject`.
> >
> > If a subject (== article or page) is deleted all associated subobjects
> > are deleted as well. If you want to remove a specific subobject then
> > you have the remove that particular #subobject call from your subject.
> >
> > [0]
> >
> https://semantic-mediawiki.org/wiki/Help:Adding_subobjects#Conceptional_notes
> >
> > [1] This statement is a simplification but should help to clarify the
> > issue raised.
> >
> > Cheers
> >
> > On 10/24/15, Josh King <[hidden email]> wrote:
> > > Update:
> > > I think I understand this slightly better now (in the least my inline
> > query
> > > to show the subobjects work). By calling my subobject template within
> my
> > > page, the page now accurately has the special "Has subobject" property
> to
> > > associate it to the subobject.
> > >
> > > My question though now is still where is that subobject data stored?
> > >
> > > If I have multiple pages all using the same subobject template (with
> the
> > > subobject given some typed out identifier), is the actual data for all
> > > those pages going into that same subobject (as I understand subobjects
> > are
> > > like invisible pages), or are multiple instances of that subobject
> being
> > > created? For that matter, how could I even see which subobjects exist
> on
> > my
> > > wiki and delete them if needed?
> > >
> > > My major concern though is that if all that data is just going to one
> > > place, then that would quickly get bogged down as my number of pages
> > using
> > > it increased.
> > >
> > > On Sat, Oct 24, 2015 at 2:40 PM, Josh King <[hidden email]>
> wrote:
> > >
> > >> Hi all,
> > >>
> > >> I'm attempting to allow my users to take advantage of multiple
> instance
> > >> sections on a form, but I can't seem to wrap my head around getting
> the
> > >> subobject data associated with the page the form creates.
> > >>
> > >> As I understand, the subobject is like it's own page and you can't
> > >> manually define that a page has a subobject-- if this is so, how can
> > that
> > >> page be associated with the semantic data in the subobject?
> > >>
> > >> Right now, my master form embeds the subobject multiple-instance
> > template
> > >> in one of it's fields, but I'm not quite sure where exactly this ends
> up
> > >> passing the information along to.
> > >>
> > >> Thanks!
> > >> Josh
> > >>
> > >
> >
> ------------------------------------------------------------------------------
> > > _______________________________________________
> > > Semediawiki-user mailing list
> > > [hidden email]
> > > https://lists.sourceforge.net/lists/listinfo/semediawiki-user
> > >
> >
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Semediawiki-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>
------------------------------------------------------------------------------
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user
Reply | Threaded
Open this post in threaded view
|

Re: Feeling lost with subobjects

Josh King
Hi Simon,

That's a good idea. I was just starting to bump into the need for this
myself as I add multiple subobjects to my page. Can you not query on the
unique identifier that you can give each subobject though? I thought that
would be more streamlined than adding extra property data.
On Oct 26, 2015 2:23 AM, "Simon Heimler" <[hidden email]> wrote:

> I'm not sure whether this is best practice, but I ended up adding two
> helper properties to each subobject I'm using.
>
> Something like:
>
> {{#subobject:
>  |Superobject:__FULLPAGENAME__​
>  |SubobjectType: NameOfTheMultipleInstanceTemplate
>  |Has number=123
> }}
>
> This allows you to write your queries for subobjects in a much more
> natural way:
>
> [[Superobject:Page A]][[SubobjectType:TemplA]] |?Has number
>
> Of course, you could replace the Superobject with an inverse property. The
> SubobjectType I find very useful, since you can clearly define to only
> query for those subobject types.
>
> Best,
> Simon
>
> 2015-10-25 3:21 GMT+01:00 Josh King <[hidden email]>:
>
>> Thank you James-- I had begun to think that I needed the anonymous
>> identifiers for my subobjects so that multiple pages wouldn't bloat them,
>> but now that I understand that subobjects really are stored within a
>> subject (instead of floating sneakily in the nether), this all makes much
>> more sense and I'll stick with my named identifiers. That solved all my
>> questions so thanks again!
>>
>> -Josh
>>
>> On Sat, Oct 24, 2015 at 6:46 PM, James HK <[hidden email]>
>> wrote:
>>
>> > Hi,
>> >
>> > > If I have multiple pages all using the same subobject template (with
>> the
>> > > subobject given some typed out identifier), is the actual data for all
>> > > those pages going into that same subobject (as I understand subobjects
>> > are
>> >
>> > No.
>> >
>> > > those pages going into that same subobject (as I understand subobjects
>> > are
>> > > like invisible pages), or are multiple instances of that subobject
>> being
>> > > created? For that matter, how could I even see which subobjects exist
>> on
>> > my
>> >
>> > Each subobject is associated with a "root" subject (a subject that
>> > embeds a subobject). Aside from this association, a subobject is
>> > encoded by a name that corresponds to the data its represents and is
>> > addressed internally via SUBJECT#NS#IW#SUBOBJECTNAME.
>> >
>> > If two subobjects describe the same thing (we assume they denote a
>> > thing with the same data) within the same subject then only one
>> > subobject is stored. [0].
>> >
>> > If two subobjects appear to describe the same thing but are embedded
>> > in two different subjects then those subobjects (in connection with
>> > the subject) represent two totally different things therefore are
>> > stored separately and distinct from each other.
>> >
>> > Subject FOO with
>> > {{#subobject:
>> >  |Has number=123
>> > }}
>> >
>> > is different from
>> >
>> > Subject BAR with
>> > {{#subobject:
>> >  |Has number=123
>> > }}
>> >
>> > A question such as "Which subject contains [[Has number::123]]" will
>> > be answered by:
>> >
>> > - FOO#_c869667efa584ce62a07d13723321630
>> > - BAR#_c869667efa584ce62a07d13723321630
>> >
>> > > My major concern though is that if all that data is just going to one
>> > > place, then that would quickly get bogged down as my number of pages
>> > using
>> > > it increased.
>> >
>> > Each subject (and each subobject) is stored as single row[1] in the DB
>> > (depending on above conditions).
>> >
>> > > created? For that matter, how could I even see which subobjects exist
>> on
>> > my
>> > > wiki and delete them if needed?
>> >
>> > Via `Special:Browse` or as list displayed in `Property:Has subobject`.
>> >
>> > If a subject (== article or page) is deleted all associated subobjects
>> > are deleted as well. If you want to remove a specific subobject then
>> > you have the remove that particular #subobject call from your subject.
>> >
>> > [0]
>> >
>> https://semantic-mediawiki.org/wiki/Help:Adding_subobjects#Conceptional_notes
>> >
>> > [1] This statement is a simplification but should help to clarify the
>> > issue raised.
>> >
>> > Cheers
>> >
>> > On 10/24/15, Josh King <[hidden email]> wrote:
>> > > Update:
>> > > I think I understand this slightly better now (in the least my inline
>> > query
>> > > to show the subobjects work). By calling my subobject template within
>> my
>> > > page, the page now accurately has the special "Has subobject"
>> property to
>> > > associate it to the subobject.
>> > >
>> > > My question though now is still where is that subobject data stored?
>> > >
>> > > If I have multiple pages all using the same subobject template (with
>> the
>> > > subobject given some typed out identifier), is the actual data for all
>> > > those pages going into that same subobject (as I understand subobjects
>> > are
>> > > like invisible pages), or are multiple instances of that subobject
>> being
>> > > created? For that matter, how could I even see which subobjects exist
>> on
>> > my
>> > > wiki and delete them if needed?
>> > >
>> > > My major concern though is that if all that data is just going to one
>> > > place, then that would quickly get bogged down as my number of pages
>> > using
>> > > it increased.
>> > >
>> > > On Sat, Oct 24, 2015 at 2:40 PM, Josh King <[hidden email]>
>> wrote:
>> > >
>> > >> Hi all,
>> > >>
>> > >> I'm attempting to allow my users to take advantage of multiple
>> instance
>> > >> sections on a form, but I can't seem to wrap my head around getting
>> the
>> > >> subobject data associated with the page the form creates.
>> > >>
>> > >> As I understand, the subobject is like it's own page and you can't
>> > >> manually define that a page has a subobject-- if this is so, how can
>> > that
>> > >> page be associated with the semantic data in the subobject?
>> > >>
>> > >> Right now, my master form embeds the subobject multiple-instance
>> > template
>> > >> in one of it's fields, but I'm not quite sure where exactly this
>> ends up
>> > >> passing the information along to.
>> > >>
>> > >> Thanks!
>> > >> Josh
>> > >>
>> > >
>> >
>> ------------------------------------------------------------------------------
>> > > _______________________________________________
>> > > Semediawiki-user mailing list
>> > > [hidden email]
>> > > https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>> > >
>> >
>>
>> ------------------------------------------------------------------------------
>> _______________________________________________
>> Semediawiki-user mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>>
>
>
------------------------------------------------------------------------------
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user
Reply | Threaded
Open this post in threaded view
|

Re: Feeling lost with subobjects

Fannon
Yes, you could also use the unique identified like [[unique-id]] and query
for it directly. The problem is, you need to know that identifier in order
to write the query. It really depends on your use-case / query if you need
those extra properties or not.

Best,
Simon

2015-10-28 4:39 GMT+01:00 Josh King <[hidden email]>:

> Hi Simon,
>
> That's a good idea. I was just starting to bump into the need for this
> myself as I add multiple subobjects to my page. Can you not query on the
> unique identifier that you can give each subobject though? I thought that
> would be more streamlined than adding extra property data.
> On Oct 26, 2015 2:23 AM, "Simon Heimler" <[hidden email]> wrote:
>
>> I'm not sure whether this is best practice, but I ended up adding two
>> helper properties to each subobject I'm using.
>>
>> Something like:
>>
>> {{#subobject:
>>  |Superobject:__FULLPAGENAME__​
>>  |SubobjectType: NameOfTheMultipleInstanceTemplate
>>  |Has number=123
>> }}
>>
>> This allows you to write your queries for subobjects in a much more
>> natural way:
>>
>> [[Superobject:Page A]][[SubobjectType:TemplA]] |?Has number
>>
>> Of course, you could replace the Superobject with an inverse property.
>> The SubobjectType I find very useful, since you can clearly define to only
>> query for those subobject types.
>>
>> Best,
>> Simon
>>
>> 2015-10-25 3:21 GMT+01:00 Josh King <[hidden email]>:
>>
>>> Thank you James-- I had begun to think that I needed the anonymous
>>> identifiers for my subobjects so that multiple pages wouldn't bloat them,
>>> but now that I understand that subobjects really are stored within a
>>> subject (instead of floating sneakily in the nether), this all makes much
>>> more sense and I'll stick with my named identifiers. That solved all my
>>> questions so thanks again!
>>>
>>> -Josh
>>>
>>> On Sat, Oct 24, 2015 at 6:46 PM, James HK <[hidden email]>
>>> wrote:
>>>
>>> > Hi,
>>> >
>>> > > If I have multiple pages all using the same subobject template (with
>>> the
>>> > > subobject given some typed out identifier), is the actual data for
>>> all
>>> > > those pages going into that same subobject (as I understand
>>> subobjects
>>> > are
>>> >
>>> > No.
>>> >
>>> > > those pages going into that same subobject (as I understand
>>> subobjects
>>> > are
>>> > > like invisible pages), or are multiple instances of that subobject
>>> being
>>> > > created? For that matter, how could I even see which subobjects
>>> exist on
>>> > my
>>> >
>>> > Each subobject is associated with a "root" subject (a subject that
>>> > embeds a subobject). Aside from this association, a subobject is
>>> > encoded by a name that corresponds to the data its represents and is
>>> > addressed internally via SUBJECT#NS#IW#SUBOBJECTNAME.
>>> >
>>> > If two subobjects describe the same thing (we assume they denote a
>>> > thing with the same data) within the same subject then only one
>>> > subobject is stored. [0].
>>> >
>>> > If two subobjects appear to describe the same thing but are embedded
>>> > in two different subjects then those subobjects (in connection with
>>> > the subject) represent two totally different things therefore are
>>> > stored separately and distinct from each other.
>>> >
>>> > Subject FOO with
>>> > {{#subobject:
>>> >  |Has number=123
>>> > }}
>>> >
>>> > is different from
>>> >
>>> > Subject BAR with
>>> > {{#subobject:
>>> >  |Has number=123
>>> > }}
>>> >
>>> > A question such as "Which subject contains [[Has number::123]]" will
>>> > be answered by:
>>> >
>>> > - FOO#_c869667efa584ce62a07d13723321630
>>> > - BAR#_c869667efa584ce62a07d13723321630
>>> >
>>> > > My major concern though is that if all that data is just going to one
>>> > > place, then that would quickly get bogged down as my number of pages
>>> > using
>>> > > it increased.
>>> >
>>> > Each subject (and each subobject) is stored as single row[1] in the DB
>>> > (depending on above conditions).
>>> >
>>> > > created? For that matter, how could I even see which subobjects
>>> exist on
>>> > my
>>> > > wiki and delete them if needed?
>>> >
>>> > Via `Special:Browse` or as list displayed in `Property:Has subobject`.
>>> >
>>> > If a subject (== article or page) is deleted all associated subobjects
>>> > are deleted as well. If you want to remove a specific subobject then
>>> > you have the remove that particular #subobject call from your subject.
>>> >
>>> > [0]
>>> >
>>> https://semantic-mediawiki.org/wiki/Help:Adding_subobjects#Conceptional_notes
>>> >
>>> > [1] This statement is a simplification but should help to clarify the
>>> > issue raised.
>>> >
>>> > Cheers
>>> >
>>> > On 10/24/15, Josh King <[hidden email]> wrote:
>>> > > Update:
>>> > > I think I understand this slightly better now (in the least my inline
>>> > query
>>> > > to show the subobjects work). By calling my subobject template
>>> within my
>>> > > page, the page now accurately has the special "Has subobject"
>>> property to
>>> > > associate it to the subobject.
>>> > >
>>> > > My question though now is still where is that subobject data stored?
>>> > >
>>> > > If I have multiple pages all using the same subobject template (with
>>> the
>>> > > subobject given some typed out identifier), is the actual data for
>>> all
>>> > > those pages going into that same subobject (as I understand
>>> subobjects
>>> > are
>>> > > like invisible pages), or are multiple instances of that subobject
>>> being
>>> > > created? For that matter, how could I even see which subobjects
>>> exist on
>>> > my
>>> > > wiki and delete them if needed?
>>> > >
>>> > > My major concern though is that if all that data is just going to one
>>> > > place, then that would quickly get bogged down as my number of pages
>>> > using
>>> > > it increased.
>>> > >
>>> > > On Sat, Oct 24, 2015 at 2:40 PM, Josh King <[hidden email]>
>>> wrote:
>>> > >
>>> > >> Hi all,
>>> > >>
>>> > >> I'm attempting to allow my users to take advantage of multiple
>>> instance
>>> > >> sections on a form, but I can't seem to wrap my head around getting
>>> the
>>> > >> subobject data associated with the page the form creates.
>>> > >>
>>> > >> As I understand, the subobject is like it's own page and you can't
>>> > >> manually define that a page has a subobject-- if this is so, how can
>>> > that
>>> > >> page be associated with the semantic data in the subobject?
>>> > >>
>>> > >> Right now, my master form embeds the subobject multiple-instance
>>> > template
>>> > >> in one of it's fields, but I'm not quite sure where exactly this
>>> ends up
>>> > >> passing the information along to.
>>> > >>
>>> > >> Thanks!
>>> > >> Josh
>>> > >>
>>> > >
>>> >
>>> ------------------------------------------------------------------------------
>>> > > _______________________________________________
>>> > > Semediawiki-user mailing list
>>> > > [hidden email]
>>> > > https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>>> > >
>>> >
>>>
>>> ------------------------------------------------------------------------------
>>> _______________________________________________
>>> Semediawiki-user mailing list
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>>>
>>
>>
------------------------------------------------------------------------------
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user
Reply | Threaded
Open this post in threaded view
|

Re: Feeling lost with subobjects

Josh King
Hi Simon,

Thanks for the responses so far. When I asked that previously, I hadn't
tried that query yet and now realize I'm not even sure what it would look
like in the ask statement. The SMW documentation on this:
https://www.semantic-mediawiki.org/wiki/Help:Subobjects_and_queries
only seems to offer the ability to do it by page and by some property
within the subobject (and not the unique identifier).

Are you saying then that a query such as:

{{#ask:
[[unique-id]]
[[-Has subobject::{{FULLPAGENAME}}]]
|?YourSubobjectProperty1
...
}}

would pull all subobjects on FULLPAGENAME that have the id "unique-id"?

That would be great for me as nearly all of my pages are done by form (I'll
know the ID), but I do like your property workaround also.

Thanks,
Josh

On Wed, Oct 28, 2015 at 12:16 AM, Simon Heimler <[hidden email]>
wrote:

> Yes, you could also use the unique identified like [[unique-id]] and query
> for it directly. The problem is, you need to know that identifier in order
> to write the query. It really depends on your use-case / query if you need
> those extra properties or not.
>
> Best,
> Simon
>
> 2015-10-28 4:39 GMT+01:00 Josh King <[hidden email]>:
>
>> Hi Simon,
>>
>> That's a good idea. I was just starting to bump into the need for this
>> myself as I add multiple subobjects to my page. Can you not query on the
>> unique identifier that you can give each subobject though? I thought that
>> would be more streamlined than adding extra property data.
>> On Oct 26, 2015 2:23 AM, "Simon Heimler" <[hidden email]> wrote:
>>
>>> I'm not sure whether this is best practice, but I ended up adding two
>>> helper properties to each subobject I'm using.
>>>
>>> Something like:
>>>
>>> {{#subobject:
>>>  |Superobject:__FULLPAGENAME__​
>>>  |SubobjectType: NameOfTheMultipleInstanceTemplate
>>>  |Has number=123
>>> }}
>>>
>>> This allows you to write your queries for subobjects in a much more
>>> natural way:
>>>
>>> [[Superobject:Page A]][[SubobjectType:TemplA]] |?Has number
>>>
>>> Of course, you could replace the Superobject with an inverse property.
>>> The SubobjectType I find very useful, since you can clearly define to only
>>> query for those subobject types.
>>>
>>> Best,
>>> Simon
>>>
>>> 2015-10-25 3:21 GMT+01:00 Josh King <[hidden email]>:
>>>
>>>> Thank you James-- I had begun to think that I needed the anonymous
>>>> identifiers for my subobjects so that multiple pages wouldn't bloat
>>>> them,
>>>> but now that I understand that subobjects really are stored within a
>>>> subject (instead of floating sneakily in the nether), this all makes
>>>> much
>>>> more sense and I'll stick with my named identifiers. That solved all my
>>>> questions so thanks again!
>>>>
>>>> -Josh
>>>>
>>>> On Sat, Oct 24, 2015 at 6:46 PM, James HK <[hidden email]
>>>> >
>>>> wrote:
>>>>
>>>> > Hi,
>>>> >
>>>> > > If I have multiple pages all using the same subobject template
>>>> (with the
>>>> > > subobject given some typed out identifier), is the actual data for
>>>> all
>>>> > > those pages going into that same subobject (as I understand
>>>> subobjects
>>>> > are
>>>> >
>>>> > No.
>>>> >
>>>> > > those pages going into that same subobject (as I understand
>>>> subobjects
>>>> > are
>>>> > > like invisible pages), or are multiple instances of that subobject
>>>> being
>>>> > > created? For that matter, how could I even see which subobjects
>>>> exist on
>>>> > my
>>>> >
>>>> > Each subobject is associated with a "root" subject (a subject that
>>>> > embeds a subobject). Aside from this association, a subobject is
>>>> > encoded by a name that corresponds to the data its represents and is
>>>> > addressed internally via SUBJECT#NS#IW#SUBOBJECTNAME.
>>>> >
>>>> > If two subobjects describe the same thing (we assume they denote a
>>>> > thing with the same data) within the same subject then only one
>>>> > subobject is stored. [0].
>>>> >
>>>> > If two subobjects appear to describe the same thing but are embedded
>>>> > in two different subjects then those subobjects (in connection with
>>>> > the subject) represent two totally different things therefore are
>>>> > stored separately and distinct from each other.
>>>> >
>>>> > Subject FOO with
>>>> > {{#subobject:
>>>> >  |Has number=123
>>>> > }}
>>>> >
>>>> > is different from
>>>> >
>>>> > Subject BAR with
>>>> > {{#subobject:
>>>> >  |Has number=123
>>>> > }}
>>>> >
>>>> > A question such as "Which subject contains [[Has number::123]]" will
>>>> > be answered by:
>>>> >
>>>> > - FOO#_c869667efa584ce62a07d13723321630
>>>> > - BAR#_c869667efa584ce62a07d13723321630
>>>> >
>>>> > > My major concern though is that if all that data is just going to
>>>> one
>>>> > > place, then that would quickly get bogged down as my number of pages
>>>> > using
>>>> > > it increased.
>>>> >
>>>> > Each subject (and each subobject) is stored as single row[1] in the DB
>>>> > (depending on above conditions).
>>>> >
>>>> > > created? For that matter, how could I even see which subobjects
>>>> exist on
>>>> > my
>>>> > > wiki and delete them if needed?
>>>> >
>>>> > Via `Special:Browse` or as list displayed in `Property:Has subobject`.
>>>> >
>>>> > If a subject (== article or page) is deleted all associated subobjects
>>>> > are deleted as well. If you want to remove a specific subobject then
>>>> > you have the remove that particular #subobject call from your subject.
>>>> >
>>>> > [0]
>>>> >
>>>> https://semantic-mediawiki.org/wiki/Help:Adding_subobjects#Conceptional_notes
>>>> >
>>>> > [1] This statement is a simplification but should help to clarify the
>>>> > issue raised.
>>>> >
>>>> > Cheers
>>>> >
>>>> > On 10/24/15, Josh King <[hidden email]> wrote:
>>>> > > Update:
>>>> > > I think I understand this slightly better now (in the least my
>>>> inline
>>>> > query
>>>> > > to show the subobjects work). By calling my subobject template
>>>> within my
>>>> > > page, the page now accurately has the special "Has subobject"
>>>> property to
>>>> > > associate it to the subobject.
>>>> > >
>>>> > > My question though now is still where is that subobject data stored?
>>>> > >
>>>> > > If I have multiple pages all using the same subobject template
>>>> (with the
>>>> > > subobject given some typed out identifier), is the actual data for
>>>> all
>>>> > > those pages going into that same subobject (as I understand
>>>> subobjects
>>>> > are
>>>> > > like invisible pages), or are multiple instances of that subobject
>>>> being
>>>> > > created? For that matter, how could I even see which subobjects
>>>> exist on
>>>> > my
>>>> > > wiki and delete them if needed?
>>>> > >
>>>> > > My major concern though is that if all that data is just going to
>>>> one
>>>> > > place, then that would quickly get bogged down as my number of pages
>>>> > using
>>>> > > it increased.
>>>> > >
>>>> > > On Sat, Oct 24, 2015 at 2:40 PM, Josh King <[hidden email]>
>>>> wrote:
>>>> > >
>>>> > >> Hi all,
>>>> > >>
>>>> > >> I'm attempting to allow my users to take advantage of multiple
>>>> instance
>>>> > >> sections on a form, but I can't seem to wrap my head around
>>>> getting the
>>>> > >> subobject data associated with the page the form creates.
>>>> > >>
>>>> > >> As I understand, the subobject is like it's own page and you can't
>>>> > >> manually define that a page has a subobject-- if this is so, how
>>>> can
>>>> > that
>>>> > >> page be associated with the semantic data in the subobject?
>>>> > >>
>>>> > >> Right now, my master form embeds the subobject multiple-instance
>>>> > template
>>>> > >> in one of it's fields, but I'm not quite sure where exactly this
>>>> ends up
>>>> > >> passing the information along to.
>>>> > >>
>>>> > >> Thanks!
>>>> > >> Josh
>>>> > >>
>>>> > >
>>>> >
>>>> ------------------------------------------------------------------------------
>>>> > > _______________________________________________
>>>> > > Semediawiki-user mailing list
>>>> > > [hidden email]
>>>> > > https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>>>> > >
>>>> >
>>>>
>>>> ------------------------------------------------------------------------------
>>>> _______________________________________________
>>>> Semediawiki-user mailing list
>>>> [hidden email]
>>>> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>>>>
>>>
>>>
>
------------------------------------------------------------------------------
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user
Reply | Threaded
Open this post in threaded view
|

Re: Feeling lost with subobjects

Josh King
I can confirm now that the code snippet mentioned above doesn't work; Im
also inclined to believe through my attempts that theirs no way to query on
the subobjects ID (which would seem a needed or obvious ability to me so
maybe im missing it), but Simon's work around of using a labelling property
works in the meantime for me.
On Oct 28, 2015 7:18 AM, "Josh King" <[hidden email]> wrote:

> Hi Simon,
>
> Thanks for the responses so far. When I asked that previously, I hadn't
> tried that query yet and now realize I'm not even sure what it would look
> like in the ask statement. The SMW documentation on this:
> https://www.semantic-mediawiki.org/wiki/Help:Subobjects_and_queries
> only seems to offer the ability to do it by page and by some property
> within the subobject (and not the unique identifier).
>
> Are you saying then that a query such as:
>
> {{#ask:
> [[unique-id]]
> [[-Has subobject::{{FULLPAGENAME}}]]
> |?YourSubobjectProperty1
> ...
> }}
>
> would pull all subobjects on FULLPAGENAME that have the id "unique-id"?
>
> That would be great for me as nearly all of my pages are done by form
> (I'll know the ID), but I do like your property workaround also.
>
> Thanks,
> Josh
>
> On Wed, Oct 28, 2015 at 12:16 AM, Simon Heimler <[hidden email]>
> wrote:
>
>> Yes, you could also use the unique identified like [[unique-id]] and
>> query for it directly. The problem is, you need to know that identifier in
>> order to write the query. It really depends on your use-case / query if you
>> need those extra properties or not.
>>
>> Best,
>> Simon
>>
>> 2015-10-28 4:39 GMT+01:00 Josh King <[hidden email]>:
>>
>>> Hi Simon,
>>>
>>> That's a good idea. I was just starting to bump into the need for this
>>> myself as I add multiple subobjects to my page. Can you not query on the
>>> unique identifier that you can give each subobject though? I thought that
>>> would be more streamlined than adding extra property data.
>>> On Oct 26, 2015 2:23 AM, "Simon Heimler" <[hidden email]> wrote:
>>>
>>>> I'm not sure whether this is best practice, but I ended up adding two
>>>> helper properties to each subobject I'm using.
>>>>
>>>> Something like:
>>>>
>>>> {{#subobject:
>>>>  |Superobject:__FULLPAGENAME__​
>>>>  |SubobjectType: NameOfTheMultipleInstanceTemplate
>>>>  |Has number=123
>>>> }}
>>>>
>>>> This allows you to write your queries for subobjects in a much more
>>>> natural way:
>>>>
>>>> [[Superobject:Page A]][[SubobjectType:TemplA]] |?Has number
>>>>
>>>> Of course, you could replace the Superobject with an inverse property.
>>>> The SubobjectType I find very useful, since you can clearly define to only
>>>> query for those subobject types.
>>>>
>>>> Best,
>>>> Simon
>>>>
>>>> 2015-10-25 3:21 GMT+01:00 Josh King <[hidden email]>:
>>>>
>>>>> Thank you James-- I had begun to think that I needed the anonymous
>>>>> identifiers for my subobjects so that multiple pages wouldn't bloat
>>>>> them,
>>>>> but now that I understand that subobjects really are stored within a
>>>>> subject (instead of floating sneakily in the nether), this all makes
>>>>> much
>>>>> more sense and I'll stick with my named identifiers. That solved all my
>>>>> questions so thanks again!
>>>>>
>>>>> -Josh
>>>>>
>>>>> On Sat, Oct 24, 2015 at 6:46 PM, James HK <
>>>>> [hidden email]>
>>>>> wrote:
>>>>>
>>>>> > Hi,
>>>>> >
>>>>> > > If I have multiple pages all using the same subobject template
>>>>> (with the
>>>>> > > subobject given some typed out identifier), is the actual data for
>>>>> all
>>>>> > > those pages going into that same subobject (as I understand
>>>>> subobjects
>>>>> > are
>>>>> >
>>>>> > No.
>>>>> >
>>>>> > > those pages going into that same subobject (as I understand
>>>>> subobjects
>>>>> > are
>>>>> > > like invisible pages), or are multiple instances of that subobject
>>>>> being
>>>>> > > created? For that matter, how could I even see which subobjects
>>>>> exist on
>>>>> > my
>>>>> >
>>>>> > Each subobject is associated with a "root" subject (a subject that
>>>>> > embeds a subobject). Aside from this association, a subobject is
>>>>> > encoded by a name that corresponds to the data its represents and is
>>>>> > addressed internally via SUBJECT#NS#IW#SUBOBJECTNAME.
>>>>> >
>>>>> > If two subobjects describe the same thing (we assume they denote a
>>>>> > thing with the same data) within the same subject then only one
>>>>> > subobject is stored. [0].
>>>>> >
>>>>> > If two subobjects appear to describe the same thing but are embedded
>>>>> > in two different subjects then those subobjects (in connection with
>>>>> > the subject) represent two totally different things therefore are
>>>>> > stored separately and distinct from each other.
>>>>> >
>>>>> > Subject FOO with
>>>>> > {{#subobject:
>>>>> >  |Has number=123
>>>>> > }}
>>>>> >
>>>>> > is different from
>>>>> >
>>>>> > Subject BAR with
>>>>> > {{#subobject:
>>>>> >  |Has number=123
>>>>> > }}
>>>>> >
>>>>> > A question such as "Which subject contains [[Has number::123]]" will
>>>>> > be answered by:
>>>>> >
>>>>> > - FOO#_c869667efa584ce62a07d13723321630
>>>>> > - BAR#_c869667efa584ce62a07d13723321630
>>>>> >
>>>>> > > My major concern though is that if all that data is just going to
>>>>> one
>>>>> > > place, then that would quickly get bogged down as my number of
>>>>> pages
>>>>> > using
>>>>> > > it increased.
>>>>> >
>>>>> > Each subject (and each subobject) is stored as single row[1] in the
>>>>> DB
>>>>> > (depending on above conditions).
>>>>> >
>>>>> > > created? For that matter, how could I even see which subobjects
>>>>> exist on
>>>>> > my
>>>>> > > wiki and delete them if needed?
>>>>> >
>>>>> > Via `Special:Browse` or as list displayed in `Property:Has
>>>>> subobject`.
>>>>> >
>>>>> > If a subject (== article or page) is deleted all associated
>>>>> subobjects
>>>>> > are deleted as well. If you want to remove a specific subobject then
>>>>> > you have the remove that particular #subobject call from your
>>>>> subject.
>>>>> >
>>>>> > [0]
>>>>> >
>>>>> https://semantic-mediawiki.org/wiki/Help:Adding_subobjects#Conceptional_notes
>>>>> >
>>>>> > [1] This statement is a simplification but should help to clarify the
>>>>> > issue raised.
>>>>> >
>>>>> > Cheers
>>>>> >
>>>>> > On 10/24/15, Josh King <[hidden email]> wrote:
>>>>> > > Update:
>>>>> > > I think I understand this slightly better now (in the least my
>>>>> inline
>>>>> > query
>>>>> > > to show the subobjects work). By calling my subobject template
>>>>> within my
>>>>> > > page, the page now accurately has the special "Has subobject"
>>>>> property to
>>>>> > > associate it to the subobject.
>>>>> > >
>>>>> > > My question though now is still where is that subobject data
>>>>> stored?
>>>>> > >
>>>>> > > If I have multiple pages all using the same subobject template
>>>>> (with the
>>>>> > > subobject given some typed out identifier), is the actual data for
>>>>> all
>>>>> > > those pages going into that same subobject (as I understand
>>>>> subobjects
>>>>> > are
>>>>> > > like invisible pages), or are multiple instances of that subobject
>>>>> being
>>>>> > > created? For that matter, how could I even see which subobjects
>>>>> exist on
>>>>> > my
>>>>> > > wiki and delete them if needed?
>>>>> > >
>>>>> > > My major concern though is that if all that data is just going to
>>>>> one
>>>>> > > place, then that would quickly get bogged down as my number of
>>>>> pages
>>>>> > using
>>>>> > > it increased.
>>>>> > >
>>>>> > > On Sat, Oct 24, 2015 at 2:40 PM, Josh King <[hidden email]>
>>>>> wrote:
>>>>> > >
>>>>> > >> Hi all,
>>>>> > >>
>>>>> > >> I'm attempting to allow my users to take advantage of multiple
>>>>> instance
>>>>> > >> sections on a form, but I can't seem to wrap my head around
>>>>> getting the
>>>>> > >> subobject data associated with the page the form creates.
>>>>> > >>
>>>>> > >> As I understand, the subobject is like it's own page and you can't
>>>>> > >> manually define that a page has a subobject-- if this is so, how
>>>>> can
>>>>> > that
>>>>> > >> page be associated with the semantic data in the subobject?
>>>>> > >>
>>>>> > >> Right now, my master form embeds the subobject multiple-instance
>>>>> > template
>>>>> > >> in one of it's fields, but I'm not quite sure where exactly this
>>>>> ends up
>>>>> > >> passing the information along to.
>>>>> > >>
>>>>> > >> Thanks!
>>>>> > >> Josh
>>>>> > >>
>>>>> > >
>>>>> >
>>>>> ------------------------------------------------------------------------------
>>>>> > > _______________________________________________
>>>>> > > Semediawiki-user mailing list
>>>>> > > [hidden email]
>>>>> > > https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>>>>> > >
>>>>> >
>>>>>
>>>>> ------------------------------------------------------------------------------
>>>>> _______________________________________________
>>>>> Semediawiki-user mailing list
>>>>> [hidden email]
>>>>> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>>>>>
>>>>
>>>>
>>
>
------------------------------------------------------------------------------
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user
Reply | Threaded
Open this post in threaded view
|

Re: Feeling lost with subobjects

Fannon
Hello Josh,

the problem with subobject IDs is that they need to be unique throughout
the wiki. The query you're made as an example doesn't make sense in one
point: You're selecting a subobject through an ID AND through an additional
selector. The ID selection is already returning exactly 1 or 0 results.

Since you usually add subobjects through multiple instance templates,
you've got the problem how to assign each one automatically a new ID -
otherwise you would get collisions. That's why the anonymous identifier (
https://www.semantic-mediawiki.org/wiki/Help:Adding_subobjects#Anonymous_identifier)
makes a lot of sense. In this case, a hash string will be appended to
ensure that the subobject has a unique ID. Please note that changing the
content of the subobject leads to a new hash, so you really can't depend on
selecting it through the ID anyway.

That's the reason why I've ended up using those two helper properties

Best,
Simon


2015-10-29 21:22 GMT+01:00 Josh King <[hidden email]>:

> I can confirm now that the code snippet mentioned above doesn't work; Im
> also inclined to believe through my attempts that theirs no way to query on
> the subobjects ID (which would seem a needed or obvious ability to me so
> maybe im missing it), but Simon's work around of using a labelling property
> works in the meantime for me.
> On Oct 28, 2015 7:18 AM, "Josh King" <[hidden email]> wrote:
>
>> Hi Simon,
>>
>> Thanks for the responses so far. When I asked that previously, I hadn't
>> tried that query yet and now realize I'm not even sure what it would look
>> like in the ask statement. The SMW documentation on this:
>> https://www.semantic-mediawiki.org/wiki/Help:Subobjects_and_queries
>> only seems to offer the ability to do it by page and by some property
>> within the subobject (and not the unique identifier).
>>
>> Are you saying then that a query such as:
>>
>> {{#ask:
>> [[unique-id]]
>> [[-Has subobject::{{FULLPAGENAME}}]]
>> |?YourSubobjectProperty1
>> ...
>> }}
>>
>> would pull all subobjects on FULLPAGENAME that have the id "unique-id"?
>>
>> That would be great for me as nearly all of my pages are done by form
>> (I'll know the ID), but I do like your property workaround also.
>>
>> Thanks,
>> Josh
>>
>> On Wed, Oct 28, 2015 at 12:16 AM, Simon Heimler <[hidden email]>
>> wrote:
>>
>>> Yes, you could also use the unique identified like [[unique-id]] and
>>> query for it directly. The problem is, you need to know that identifier in
>>> order to write the query. It really depends on your use-case / query if you
>>> need those extra properties or not.
>>>
>>> Best,
>>> Simon
>>>
>>> 2015-10-28 4:39 GMT+01:00 Josh King <[hidden email]>:
>>>
>>>> Hi Simon,
>>>>
>>>> That's a good idea. I was just starting to bump into the need for this
>>>> myself as I add multiple subobjects to my page. Can you not query on the
>>>> unique identifier that you can give each subobject though? I thought that
>>>> would be more streamlined than adding extra property data.
>>>> On Oct 26, 2015 2:23 AM, "Simon Heimler" <[hidden email]>
>>>> wrote:
>>>>
>>>>> I'm not sure whether this is best practice, but I ended up adding two
>>>>> helper properties to each subobject I'm using.
>>>>>
>>>>> Something like:
>>>>>
>>>>> {{#subobject:
>>>>>  |Superobject:__FULLPAGENAME__​
>>>>>  |SubobjectType: NameOfTheMultipleInstanceTemplate
>>>>>  |Has number=123
>>>>> }}
>>>>>
>>>>> This allows you to write your queries for subobjects in a much more
>>>>> natural way:
>>>>>
>>>>> [[Superobject:Page A]][[SubobjectType:TemplA]] |?Has number
>>>>>
>>>>> Of course, you could replace the Superobject with an inverse property.
>>>>> The SubobjectType I find very useful, since you can clearly define to only
>>>>> query for those subobject types.
>>>>>
>>>>> Best,
>>>>> Simon
>>>>>
>>>>> 2015-10-25 3:21 GMT+01:00 Josh King <[hidden email]>:
>>>>>
>>>>>> Thank you James-- I had begun to think that I needed the anonymous
>>>>>> identifiers for my subobjects so that multiple pages wouldn't bloat
>>>>>> them,
>>>>>> but now that I understand that subobjects really are stored within a
>>>>>> subject (instead of floating sneakily in the nether), this all makes
>>>>>> much
>>>>>> more sense and I'll stick with my named identifiers. That solved all
>>>>>> my
>>>>>> questions so thanks again!
>>>>>>
>>>>>> -Josh
>>>>>>
>>>>>> On Sat, Oct 24, 2015 at 6:46 PM, James HK <
>>>>>> [hidden email]>
>>>>>> wrote:
>>>>>>
>>>>>> > Hi,
>>>>>> >
>>>>>> > > If I have multiple pages all using the same subobject template
>>>>>> (with the
>>>>>> > > subobject given some typed out identifier), is the actual data
>>>>>> for all
>>>>>> > > those pages going into that same subobject (as I understand
>>>>>> subobjects
>>>>>> > are
>>>>>> >
>>>>>> > No.
>>>>>> >
>>>>>> > > those pages going into that same subobject (as I understand
>>>>>> subobjects
>>>>>> > are
>>>>>> > > like invisible pages), or are multiple instances of that
>>>>>> subobject being
>>>>>> > > created? For that matter, how could I even see which subobjects
>>>>>> exist on
>>>>>> > my
>>>>>> >
>>>>>> > Each subobject is associated with a "root" subject (a subject that
>>>>>> > embeds a subobject). Aside from this association, a subobject is
>>>>>> > encoded by a name that corresponds to the data its represents and is
>>>>>> > addressed internally via SUBJECT#NS#IW#SUBOBJECTNAME.
>>>>>> >
>>>>>> > If two subobjects describe the same thing (we assume they denote a
>>>>>> > thing with the same data) within the same subject then only one
>>>>>> > subobject is stored. [0].
>>>>>> >
>>>>>> > If two subobjects appear to describe the same thing but are embedded
>>>>>> > in two different subjects then those subobjects (in connection with
>>>>>> > the subject) represent two totally different things therefore are
>>>>>> > stored separately and distinct from each other.
>>>>>> >
>>>>>> > Subject FOO with
>>>>>> > {{#subobject:
>>>>>> >  |Has number=123
>>>>>> > }}
>>>>>> >
>>>>>> > is different from
>>>>>> >
>>>>>> > Subject BAR with
>>>>>> > {{#subobject:
>>>>>> >  |Has number=123
>>>>>> > }}
>>>>>> >
>>>>>> > A question such as "Which subject contains [[Has number::123]]" will
>>>>>> > be answered by:
>>>>>> >
>>>>>> > - FOO#_c869667efa584ce62a07d13723321630
>>>>>> > - BAR#_c869667efa584ce62a07d13723321630
>>>>>> >
>>>>>> > > My major concern though is that if all that data is just going to
>>>>>> one
>>>>>> > > place, then that would quickly get bogged down as my number of
>>>>>> pages
>>>>>> > using
>>>>>> > > it increased.
>>>>>> >
>>>>>> > Each subject (and each subobject) is stored as single row[1] in the
>>>>>> DB
>>>>>> > (depending on above conditions).
>>>>>> >
>>>>>> > > created? For that matter, how could I even see which subobjects
>>>>>> exist on
>>>>>> > my
>>>>>> > > wiki and delete them if needed?
>>>>>> >
>>>>>> > Via `Special:Browse` or as list displayed in `Property:Has
>>>>>> subobject`.
>>>>>> >
>>>>>> > If a subject (== article or page) is deleted all associated
>>>>>> subobjects
>>>>>> > are deleted as well. If you want to remove a specific subobject then
>>>>>> > you have the remove that particular #subobject call from your
>>>>>> subject.
>>>>>> >
>>>>>> > [0]
>>>>>> >
>>>>>> https://semantic-mediawiki.org/wiki/Help:Adding_subobjects#Conceptional_notes
>>>>>> >
>>>>>> > [1] This statement is a simplification but should help to clarify
>>>>>> the
>>>>>> > issue raised.
>>>>>> >
>>>>>> > Cheers
>>>>>> >
>>>>>> > On 10/24/15, Josh King <[hidden email]> wrote:
>>>>>> > > Update:
>>>>>> > > I think I understand this slightly better now (in the least my
>>>>>> inline
>>>>>> > query
>>>>>> > > to show the subobjects work). By calling my subobject template
>>>>>> within my
>>>>>> > > page, the page now accurately has the special "Has subobject"
>>>>>> property to
>>>>>> > > associate it to the subobject.
>>>>>> > >
>>>>>> > > My question though now is still where is that subobject data
>>>>>> stored?
>>>>>> > >
>>>>>> > > If I have multiple pages all using the same subobject template
>>>>>> (with the
>>>>>> > > subobject given some typed out identifier), is the actual data
>>>>>> for all
>>>>>> > > those pages going into that same subobject (as I understand
>>>>>> subobjects
>>>>>> > are
>>>>>> > > like invisible pages), or are multiple instances of that
>>>>>> subobject being
>>>>>> > > created? For that matter, how could I even see which subobjects
>>>>>> exist on
>>>>>> > my
>>>>>> > > wiki and delete them if needed?
>>>>>> > >
>>>>>> > > My major concern though is that if all that data is just going to
>>>>>> one
>>>>>> > > place, then that would quickly get bogged down as my number of
>>>>>> pages
>>>>>> > using
>>>>>> > > it increased.
>>>>>> > >
>>>>>> > > On Sat, Oct 24, 2015 at 2:40 PM, Josh King <[hidden email]>
>>>>>> wrote:
>>>>>> > >
>>>>>> > >> Hi all,
>>>>>> > >>
>>>>>> > >> I'm attempting to allow my users to take advantage of multiple
>>>>>> instance
>>>>>> > >> sections on a form, but I can't seem to wrap my head around
>>>>>> getting the
>>>>>> > >> subobject data associated with the page the form creates.
>>>>>> > >>
>>>>>> > >> As I understand, the subobject is like it's own page and you
>>>>>> can't
>>>>>> > >> manually define that a page has a subobject-- if this is so, how
>>>>>> can
>>>>>> > that
>>>>>> > >> page be associated with the semantic data in the subobject?
>>>>>> > >>
>>>>>> > >> Right now, my master form embeds the subobject multiple-instance
>>>>>> > template
>>>>>> > >> in one of it's fields, but I'm not quite sure where exactly this
>>>>>> ends up
>>>>>> > >> passing the information along to.
>>>>>> > >>
>>>>>> > >> Thanks!
>>>>>> > >> Josh
>>>>>> > >>
>>>>>> > >
>>>>>> >
>>>>>> ------------------------------------------------------------------------------
>>>>>> > > _______________________________________________
>>>>>> > > Semediawiki-user mailing list
>>>>>> > > [hidden email]
>>>>>> > > https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>>>>>> > >
>>>>>> >
>>>>>>
>>>>>> ------------------------------------------------------------------------------
>>>>>> _______________________________________________
>>>>>> Semediawiki-user mailing list
>>>>>> [hidden email]
>>>>>> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>>>>>>
>>>>>
>>>>>
>>>
>>
------------------------------------------------------------------------------
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user
Reply | Threaded
Open this post in threaded view
|

Re: Feeling lost with subobjects

Josh King
Hi Simon,

Thanks for that extra bit of info.What you're noting was my original take
on the reading of the documentation your posting, but replies in the thread
had convinced me for some reason that I didn't need the anonymous
identifiers. As it stands right now, I'm not quite sure where the
collisions would come from?

Currently on my site I have multiple pages all using a subobject with the
same ID. Each of these pages then queries (to display) the subobject using:

{{#ask:
  [[-Has subobject::{{FULLPAGENAME}}]]
  [[Has subobject name::SubobjectIDName]]
  |?Properties to be displayed...
  ....
}}

Where "Has subobject name" is a property I defined. Currently this seems to
work and lets me display only the data unique to that page. It's also nice
that the subobject gets to keep a nice and tidy name in this way that helps
me tell it apart from other uniquely named subobjects also on that page.
Your response makes me think there's a catch I'm not seeing though?

Thanks,
Josh

On Fri, Oct 30, 2015 at 1:01 AM, Simon Heimler <[hidden email]>
wrote:

> Hello Josh,
>
> the problem with subobject IDs is that they need to be unique throughout
> the wiki. The query you're made as an example doesn't make sense in one
> point: You're selecting a subobject through an ID AND through an additional
> selector. The ID selection is already returning exactly 1 or 0 results.
>
> Since you usually add subobjects through multiple instance templates,
> you've got the problem how to assign each one automatically a new ID -
> otherwise you would get collisions. That's why the anonymous identifier (
> https://www.semantic-mediawiki.org/wiki/Help:Adding_subobjects#Anonymous_identifier)
> makes a lot of sense. In this case, a hash string will be appended to
> ensure that the subobject has a unique ID. Please note that changing the
> content of the subobject leads to a new hash, so you really can't depend on
> selecting it through the ID anyway.
>
> That's the reason why I've ended up using those two helper properties
>
> Best,
> Simon
>
>
> 2015-10-29 21:22 GMT+01:00 Josh King <[hidden email]>:
>
>> I can confirm now that the code snippet mentioned above doesn't work; Im
>> also inclined to believe through my attempts that theirs no way to query on
>> the subobjects ID (which would seem a needed or obvious ability to me so
>> maybe im missing it), but Simon's work around of using a labelling property
>> works in the meantime for me.
>> On Oct 28, 2015 7:18 AM, "Josh King" <[hidden email]> wrote:
>>
>>> Hi Simon,
>>>
>>> Thanks for the responses so far. When I asked that previously, I hadn't
>>> tried that query yet and now realize I'm not even sure what it would look
>>> like in the ask statement. The SMW documentation on this:
>>> https://www.semantic-mediawiki.org/wiki/Help:Subobjects_and_queries
>>> only seems to offer the ability to do it by page and by some property
>>> within the subobject (and not the unique identifier).
>>>
>>> Are you saying then that a query such as:
>>>
>>> {{#ask:
>>> [[unique-id]]
>>> [[-Has subobject::{{FULLPAGENAME}}]]
>>> |?YourSubobjectProperty1
>>> ...
>>> }}
>>>
>>> would pull all subobjects on FULLPAGENAME that have the id "unique-id"?
>>>
>>> That would be great for me as nearly all of my pages are done by form
>>> (I'll know the ID), but I do like your property workaround also.
>>>
>>> Thanks,
>>> Josh
>>>
>>> On Wed, Oct 28, 2015 at 12:16 AM, Simon Heimler <[hidden email]>
>>> wrote:
>>>
>>>> Yes, you could also use the unique identified like [[unique-id]] and
>>>> query for it directly. The problem is, you need to know that identifier in
>>>> order to write the query. It really depends on your use-case / query if you
>>>> need those extra properties or not.
>>>>
>>>> Best,
>>>> Simon
>>>>
>>>> 2015-10-28 4:39 GMT+01:00 Josh King <[hidden email]>:
>>>>
>>>>> Hi Simon,
>>>>>
>>>>> That's a good idea. I was just starting to bump into the need for this
>>>>> myself as I add multiple subobjects to my page. Can you not query on the
>>>>> unique identifier that you can give each subobject though? I thought that
>>>>> would be more streamlined than adding extra property data.
>>>>> On Oct 26, 2015 2:23 AM, "Simon Heimler" <[hidden email]>
>>>>> wrote:
>>>>>
>>>>>> I'm not sure whether this is best practice, but I ended up adding two
>>>>>> helper properties to each subobject I'm using.
>>>>>>
>>>>>> Something like:
>>>>>>
>>>>>> {{#subobject:
>>>>>>  |Superobject:__FULLPAGENAME__​
>>>>>>  |SubobjectType: NameOfTheMultipleInstanceTemplate
>>>>>>  |Has number=123
>>>>>> }}
>>>>>>
>>>>>> This allows you to write your queries for subobjects in a much more
>>>>>> natural way:
>>>>>>
>>>>>> [[Superobject:Page A]][[SubobjectType:TemplA]] |?Has number
>>>>>>
>>>>>> Of course, you could replace the Superobject with an inverse
>>>>>> property. The SubobjectType I find very useful, since you can clearly
>>>>>> define to only query for those subobject types.
>>>>>>
>>>>>> Best,
>>>>>> Simon
>>>>>>
>>>>>> 2015-10-25 3:21 GMT+01:00 Josh King <[hidden email]>:
>>>>>>
>>>>>>> Thank you James-- I had begun to think that I needed the anonymous
>>>>>>> identifiers for my subobjects so that multiple pages wouldn't bloat
>>>>>>> them,
>>>>>>> but now that I understand that subobjects really are stored within a
>>>>>>> subject (instead of floating sneakily in the nether), this all makes
>>>>>>> much
>>>>>>> more sense and I'll stick with my named identifiers. That solved all
>>>>>>> my
>>>>>>> questions so thanks again!
>>>>>>>
>>>>>>> -Josh
>>>>>>>
>>>>>>> On Sat, Oct 24, 2015 at 6:46 PM, James HK <
>>>>>>> [hidden email]>
>>>>>>> wrote:
>>>>>>>
>>>>>>> > Hi,
>>>>>>> >
>>>>>>> > > If I have multiple pages all using the same subobject template
>>>>>>> (with the
>>>>>>> > > subobject given some typed out identifier), is the actual data
>>>>>>> for all
>>>>>>> > > those pages going into that same subobject (as I understand
>>>>>>> subobjects
>>>>>>> > are
>>>>>>> >
>>>>>>> > No.
>>>>>>> >
>>>>>>> > > those pages going into that same subobject (as I understand
>>>>>>> subobjects
>>>>>>> > are
>>>>>>> > > like invisible pages), or are multiple instances of that
>>>>>>> subobject being
>>>>>>> > > created? For that matter, how could I even see which subobjects
>>>>>>> exist on
>>>>>>> > my
>>>>>>> >
>>>>>>> > Each subobject is associated with a "root" subject (a subject that
>>>>>>> > embeds a subobject). Aside from this association, a subobject is
>>>>>>> > encoded by a name that corresponds to the data its represents and
>>>>>>> is
>>>>>>> > addressed internally via SUBJECT#NS#IW#SUBOBJECTNAME.
>>>>>>> >
>>>>>>> > If two subobjects describe the same thing (we assume they denote a
>>>>>>> > thing with the same data) within the same subject then only one
>>>>>>> > subobject is stored. [0].
>>>>>>> >
>>>>>>> > If two subobjects appear to describe the same thing but are
>>>>>>> embedded
>>>>>>> > in two different subjects then those subobjects (in connection with
>>>>>>> > the subject) represent two totally different things therefore are
>>>>>>> > stored separately and distinct from each other.
>>>>>>> >
>>>>>>> > Subject FOO with
>>>>>>> > {{#subobject:
>>>>>>> >  |Has number=123
>>>>>>> > }}
>>>>>>> >
>>>>>>> > is different from
>>>>>>> >
>>>>>>> > Subject BAR with
>>>>>>> > {{#subobject:
>>>>>>> >  |Has number=123
>>>>>>> > }}
>>>>>>> >
>>>>>>> > A question such as "Which subject contains [[Has number::123]]"
>>>>>>> will
>>>>>>> > be answered by:
>>>>>>> >
>>>>>>> > - FOO#_c869667efa584ce62a07d13723321630
>>>>>>> > - BAR#_c869667efa584ce62a07d13723321630
>>>>>>> >
>>>>>>> > > My major concern though is that if all that data is just going
>>>>>>> to one
>>>>>>> > > place, then that would quickly get bogged down as my number of
>>>>>>> pages
>>>>>>> > using
>>>>>>> > > it increased.
>>>>>>> >
>>>>>>> > Each subject (and each subobject) is stored as single row[1] in
>>>>>>> the DB
>>>>>>> > (depending on above conditions).
>>>>>>> >
>>>>>>> > > created? For that matter, how could I even see which subobjects
>>>>>>> exist on
>>>>>>> > my
>>>>>>> > > wiki and delete them if needed?
>>>>>>> >
>>>>>>> > Via `Special:Browse` or as list displayed in `Property:Has
>>>>>>> subobject`.
>>>>>>> >
>>>>>>> > If a subject (== article or page) is deleted all associated
>>>>>>> subobjects
>>>>>>> > are deleted as well. If you want to remove a specific subobject
>>>>>>> then
>>>>>>> > you have the remove that particular #subobject call from your
>>>>>>> subject.
>>>>>>> >
>>>>>>> > [0]
>>>>>>> >
>>>>>>> https://semantic-mediawiki.org/wiki/Help:Adding_subobjects#Conceptional_notes
>>>>>>> >
>>>>>>> > [1] This statement is a simplification but should help to clarify
>>>>>>> the
>>>>>>> > issue raised.
>>>>>>> >
>>>>>>> > Cheers
>>>>>>> >
>>>>>>> > On 10/24/15, Josh King <[hidden email]> wrote:
>>>>>>> > > Update:
>>>>>>> > > I think I understand this slightly better now (in the least my
>>>>>>> inline
>>>>>>> > query
>>>>>>> > > to show the subobjects work). By calling my subobject template
>>>>>>> within my
>>>>>>> > > page, the page now accurately has the special "Has subobject"
>>>>>>> property to
>>>>>>> > > associate it to the subobject.
>>>>>>> > >
>>>>>>> > > My question though now is still where is that subobject data
>>>>>>> stored?
>>>>>>> > >
>>>>>>> > > If I have multiple pages all using the same subobject template
>>>>>>> (with the
>>>>>>> > > subobject given some typed out identifier), is the actual data
>>>>>>> for all
>>>>>>> > > those pages going into that same subobject (as I understand
>>>>>>> subobjects
>>>>>>> > are
>>>>>>> > > like invisible pages), or are multiple instances of that
>>>>>>> subobject being
>>>>>>> > > created? For that matter, how could I even see which subobjects
>>>>>>> exist on
>>>>>>> > my
>>>>>>> > > wiki and delete them if needed?
>>>>>>> > >
>>>>>>> > > My major concern though is that if all that data is just going
>>>>>>> to one
>>>>>>> > > place, then that would quickly get bogged down as my number of
>>>>>>> pages
>>>>>>> > using
>>>>>>> > > it increased.
>>>>>>> > >
>>>>>>> > > On Sat, Oct 24, 2015 at 2:40 PM, Josh King <[hidden email]>
>>>>>>> wrote:
>>>>>>> > >
>>>>>>> > >> Hi all,
>>>>>>> > >>
>>>>>>> > >> I'm attempting to allow my users to take advantage of multiple
>>>>>>> instance
>>>>>>> > >> sections on a form, but I can't seem to wrap my head around
>>>>>>> getting the
>>>>>>> > >> subobject data associated with the page the form creates.
>>>>>>> > >>
>>>>>>> > >> As I understand, the subobject is like it's own page and you
>>>>>>> can't
>>>>>>> > >> manually define that a page has a subobject-- if this is so,
>>>>>>> how can
>>>>>>> > that
>>>>>>> > >> page be associated with the semantic data in the subobject?
>>>>>>> > >>
>>>>>>> > >> Right now, my master form embeds the subobject multiple-instance
>>>>>>> > template
>>>>>>> > >> in one of it's fields, but I'm not quite sure where exactly
>>>>>>> this ends up
>>>>>>> > >> passing the information along to.
>>>>>>> > >>
>>>>>>> > >> Thanks!
>>>>>>> > >> Josh
>>>>>>> > >>
>>>>>>> > >
>>>>>>> >
>>>>>>> ------------------------------------------------------------------------------
>>>>>>> > > _______________________________________________
>>>>>>> > > Semediawiki-user mailing list
>>>>>>> > > [hidden email]
>>>>>>> > > https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>>>>>>> > >
>>>>>>> >
>>>>>>>
>>>>>>> ------------------------------------------------------------------------------
>>>>>>> _______________________________________________
>>>>>>> Semediawiki-user mailing list
>>>>>>> [hidden email]
>>>>>>> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>>>>>>>
>>>>>>
>>>>>>
>>>>
>>>
>
------------------------------------------------------------------------------
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user
Reply | Threaded
Open this post in threaded view
|

Re: Feeling lost with subobjects

Fannon
Ok, that's interesting.

Actually, I haven't tested all possibilities here and I have misinterpreted
something. There may be no catch ;).

Maybe some more experienced SMW users can give some more explanations?

Best,
Simon

2015-11-03 3:32 GMT+01:00 Josh King <[hidden email]>:

> Hi Simon,
>
> Thanks for that extra bit of info.What you're noting was my original take
> on the reading of the documentation your posting, but replies in the thread
> had convinced me for some reason that I didn't need the anonymous
> identifiers. As it stands right now, I'm not quite sure where the
> collisions would come from?
>
> Currently on my site I have multiple pages all using a subobject with the
> same ID. Each of these pages then queries (to display) the subobject using:
>
> {{#ask:
>   [[-Has subobject::{{FULLPAGENAME}}]]
>   [[Has subobject name::SubobjectIDName]]
>   |?Properties to be displayed...
>   ....
> }}
>
> Where "Has subobject name" is a property I defined. Currently this seems
> to work and lets me display only the data unique to that page. It's also
> nice that the subobject gets to keep a nice and tidy name in this way that
> helps me tell it apart from other uniquely named subobjects also on that
> page. Your response makes me think there's a catch I'm not seeing though?
>
> Thanks,
> Josh
>
> On Fri, Oct 30, 2015 at 1:01 AM, Simon Heimler <[hidden email]>
> wrote:
>
>> Hello Josh,
>>
>> the problem with subobject IDs is that they need to be unique throughout
>> the wiki. The query you're made as an example doesn't make sense in one
>> point: You're selecting a subobject through an ID AND through an additional
>> selector. The ID selection is already returning exactly 1 or 0 results.
>>
>> Since you usually add subobjects through multiple instance templates,
>> you've got the problem how to assign each one automatically a new ID -
>> otherwise you would get collisions. That's why the anonymous identifier (
>> https://www.semantic-mediawiki.org/wiki/Help:Adding_subobjects#Anonymous_identifier)
>> makes a lot of sense. In this case, a hash string will be appended to
>> ensure that the subobject has a unique ID. Please note that changing the
>> content of the subobject leads to a new hash, so you really can't depend on
>> selecting it through the ID anyway.
>>
>> That's the reason why I've ended up using those two helper properties
>>
>> Best,
>> Simon
>>
>>
>> 2015-10-29 21:22 GMT+01:00 Josh King <[hidden email]>:
>>
>>> I can confirm now that the code snippet mentioned above doesn't work; Im
>>> also inclined to believe through my attempts that theirs no way to query on
>>> the subobjects ID (which would seem a needed or obvious ability to me so
>>> maybe im missing it), but Simon's work around of using a labelling property
>>> works in the meantime for me.
>>> On Oct 28, 2015 7:18 AM, "Josh King" <[hidden email]> wrote:
>>>
>>>> Hi Simon,
>>>>
>>>> Thanks for the responses so far. When I asked that previously, I hadn't
>>>> tried that query yet and now realize I'm not even sure what it would look
>>>> like in the ask statement. The SMW documentation on this:
>>>> https://www.semantic-mediawiki.org/wiki/Help:Subobjects_and_queries
>>>> only seems to offer the ability to do it by page and by some property
>>>> within the subobject (and not the unique identifier).
>>>>
>>>> Are you saying then that a query such as:
>>>>
>>>> {{#ask:
>>>> [[unique-id]]
>>>> [[-Has subobject::{{FULLPAGENAME}}]]
>>>> |?YourSubobjectProperty1
>>>> ...
>>>> }}
>>>>
>>>> would pull all subobjects on FULLPAGENAME that have the id "unique-id"?
>>>>
>>>> That would be great for me as nearly all of my pages are done by form
>>>> (I'll know the ID), but I do like your property workaround also.
>>>>
>>>> Thanks,
>>>> Josh
>>>>
>>>> On Wed, Oct 28, 2015 at 12:16 AM, Simon Heimler <[hidden email]
>>>> > wrote:
>>>>
>>>>> Yes, you could also use the unique identified like [[unique-id]] and
>>>>> query for it directly. The problem is, you need to know that identifier in
>>>>> order to write the query. It really depends on your use-case / query if you
>>>>> need those extra properties or not.
>>>>>
>>>>> Best,
>>>>> Simon
>>>>>
>>>>> 2015-10-28 4:39 GMT+01:00 Josh King <[hidden email]>:
>>>>>
>>>>>> Hi Simon,
>>>>>>
>>>>>> That's a good idea. I was just starting to bump into the need for
>>>>>> this myself as I add multiple subobjects to my page. Can you not query on
>>>>>> the unique identifier that you can give each subobject though? I thought
>>>>>> that would be more streamlined than adding extra property data.
>>>>>> On Oct 26, 2015 2:23 AM, "Simon Heimler" <[hidden email]>
>>>>>> wrote:
>>>>>>
>>>>>>> I'm not sure whether this is best practice, but I ended up adding
>>>>>>> two helper properties to each subobject I'm using.
>>>>>>>
>>>>>>> Something like:
>>>>>>>
>>>>>>> {{#subobject:
>>>>>>>  |Superobject:__FULLPAGENAME__​
>>>>>>>  |SubobjectType: NameOfTheMultipleInstanceTemplate
>>>>>>>  |Has number=123
>>>>>>> }}
>>>>>>>
>>>>>>> This allows you to write your queries for subobjects in a much more
>>>>>>> natural way:
>>>>>>>
>>>>>>> [[Superobject:Page A]][[SubobjectType:TemplA]] |?Has number
>>>>>>>
>>>>>>> Of course, you could replace the Superobject with an inverse
>>>>>>> property. The SubobjectType I find very useful, since you can clearly
>>>>>>> define to only query for those subobject types.
>>>>>>>
>>>>>>> Best,
>>>>>>> Simon
>>>>>>>
>>>>>>> 2015-10-25 3:21 GMT+01:00 Josh King <[hidden email]>:
>>>>>>>
>>>>>>>> Thank you James-- I had begun to think that I needed the anonymous
>>>>>>>> identifiers for my subobjects so that multiple pages wouldn't bloat
>>>>>>>> them,
>>>>>>>> but now that I understand that subobjects really are stored within a
>>>>>>>> subject (instead of floating sneakily in the nether), this all
>>>>>>>> makes much
>>>>>>>> more sense and I'll stick with my named identifiers. That solved
>>>>>>>> all my
>>>>>>>> questions so thanks again!
>>>>>>>>
>>>>>>>> -Josh
>>>>>>>>
>>>>>>>> On Sat, Oct 24, 2015 at 6:46 PM, James HK <
>>>>>>>> [hidden email]>
>>>>>>>> wrote:
>>>>>>>>
>>>>>>>> > Hi,
>>>>>>>> >
>>>>>>>> > > If I have multiple pages all using the same subobject template
>>>>>>>> (with the
>>>>>>>> > > subobject given some typed out identifier), is the actual data
>>>>>>>> for all
>>>>>>>> > > those pages going into that same subobject (as I understand
>>>>>>>> subobjects
>>>>>>>> > are
>>>>>>>> >
>>>>>>>> > No.
>>>>>>>> >
>>>>>>>> > > those pages going into that same subobject (as I understand
>>>>>>>> subobjects
>>>>>>>> > are
>>>>>>>> > > like invisible pages), or are multiple instances of that
>>>>>>>> subobject being
>>>>>>>> > > created? For that matter, how could I even see which subobjects
>>>>>>>> exist on
>>>>>>>> > my
>>>>>>>> >
>>>>>>>> > Each subobject is associated with a "root" subject (a subject that
>>>>>>>> > embeds a subobject). Aside from this association, a subobject is
>>>>>>>> > encoded by a name that corresponds to the data its represents and
>>>>>>>> is
>>>>>>>> > addressed internally via SUBJECT#NS#IW#SUBOBJECTNAME.
>>>>>>>> >
>>>>>>>> > If two subobjects describe the same thing (we assume they denote a
>>>>>>>> > thing with the same data) within the same subject then only one
>>>>>>>> > subobject is stored. [0].
>>>>>>>> >
>>>>>>>> > If two subobjects appear to describe the same thing but are
>>>>>>>> embedded
>>>>>>>> > in two different subjects then those subobjects (in connection
>>>>>>>> with
>>>>>>>> > the subject) represent two totally different things therefore are
>>>>>>>> > stored separately and distinct from each other.
>>>>>>>> >
>>>>>>>> > Subject FOO with
>>>>>>>> > {{#subobject:
>>>>>>>> >  |Has number=123
>>>>>>>> > }}
>>>>>>>> >
>>>>>>>> > is different from
>>>>>>>> >
>>>>>>>> > Subject BAR with
>>>>>>>> > {{#subobject:
>>>>>>>> >  |Has number=123
>>>>>>>> > }}
>>>>>>>> >
>>>>>>>> > A question such as "Which subject contains [[Has number::123]]"
>>>>>>>> will
>>>>>>>> > be answered by:
>>>>>>>> >
>>>>>>>> > - FOO#_c869667efa584ce62a07d13723321630
>>>>>>>> > - BAR#_c869667efa584ce62a07d13723321630
>>>>>>>> >
>>>>>>>> > > My major concern though is that if all that data is just going
>>>>>>>> to one
>>>>>>>> > > place, then that would quickly get bogged down as my number of
>>>>>>>> pages
>>>>>>>> > using
>>>>>>>> > > it increased.
>>>>>>>> >
>>>>>>>> > Each subject (and each subobject) is stored as single row[1] in
>>>>>>>> the DB
>>>>>>>> > (depending on above conditions).
>>>>>>>> >
>>>>>>>> > > created? For that matter, how could I even see which subobjects
>>>>>>>> exist on
>>>>>>>> > my
>>>>>>>> > > wiki and delete them if needed?
>>>>>>>> >
>>>>>>>> > Via `Special:Browse` or as list displayed in `Property:Has
>>>>>>>> subobject`.
>>>>>>>> >
>>>>>>>> > If a subject (== article or page) is deleted all associated
>>>>>>>> subobjects
>>>>>>>> > are deleted as well. If you want to remove a specific subobject
>>>>>>>> then
>>>>>>>> > you have the remove that particular #subobject call from your
>>>>>>>> subject.
>>>>>>>> >
>>>>>>>> > [0]
>>>>>>>> >
>>>>>>>> https://semantic-mediawiki.org/wiki/Help:Adding_subobjects#Conceptional_notes
>>>>>>>> >
>>>>>>>> > [1] This statement is a simplification but should help to clarify
>>>>>>>> the
>>>>>>>> > issue raised.
>>>>>>>> >
>>>>>>>> > Cheers
>>>>>>>> >
>>>>>>>> > On 10/24/15, Josh King <[hidden email]> wrote:
>>>>>>>> > > Update:
>>>>>>>> > > I think I understand this slightly better now (in the least my
>>>>>>>> inline
>>>>>>>> > query
>>>>>>>> > > to show the subobjects work). By calling my subobject template
>>>>>>>> within my
>>>>>>>> > > page, the page now accurately has the special "Has subobject"
>>>>>>>> property to
>>>>>>>> > > associate it to the subobject.
>>>>>>>> > >
>>>>>>>> > > My question though now is still where is that subobject data
>>>>>>>> stored?
>>>>>>>> > >
>>>>>>>> > > If I have multiple pages all using the same subobject template
>>>>>>>> (with the
>>>>>>>> > > subobject given some typed out identifier), is the actual data
>>>>>>>> for all
>>>>>>>> > > those pages going into that same subobject (as I understand
>>>>>>>> subobjects
>>>>>>>> > are
>>>>>>>> > > like invisible pages), or are multiple instances of that
>>>>>>>> subobject being
>>>>>>>> > > created? For that matter, how could I even see which subobjects
>>>>>>>> exist on
>>>>>>>> > my
>>>>>>>> > > wiki and delete them if needed?
>>>>>>>> > >
>>>>>>>> > > My major concern though is that if all that data is just going
>>>>>>>> to one
>>>>>>>> > > place, then that would quickly get bogged down as my number of
>>>>>>>> pages
>>>>>>>> > using
>>>>>>>> > > it increased.
>>>>>>>> > >
>>>>>>>> > > On Sat, Oct 24, 2015 at 2:40 PM, Josh King <[hidden email]>
>>>>>>>> wrote:
>>>>>>>> > >
>>>>>>>> > >> Hi all,
>>>>>>>> > >>
>>>>>>>> > >> I'm attempting to allow my users to take advantage of multiple
>>>>>>>> instance
>>>>>>>> > >> sections on a form, but I can't seem to wrap my head around
>>>>>>>> getting the
>>>>>>>> > >> subobject data associated with the page the form creates.
>>>>>>>> > >>
>>>>>>>> > >> As I understand, the subobject is like it's own page and you
>>>>>>>> can't
>>>>>>>> > >> manually define that a page has a subobject-- if this is so,
>>>>>>>> how can
>>>>>>>> > that
>>>>>>>> > >> page be associated with the semantic data in the subobject?
>>>>>>>> > >>
>>>>>>>> > >> Right now, my master form embeds the subobject
>>>>>>>> multiple-instance
>>>>>>>> > template
>>>>>>>> > >> in one of it's fields, but I'm not quite sure where exactly
>>>>>>>> this ends up
>>>>>>>> > >> passing the information along to.
>>>>>>>> > >>
>>>>>>>> > >> Thanks!
>>>>>>>> > >> Josh
>>>>>>>> > >>
>>>>>>>> > >
>>>>>>>> >
>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>> > > _______________________________________________
>>>>>>>> > > Semediawiki-user mailing list
>>>>>>>> > > [hidden email]
>>>>>>>> > > https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>>>>>>>> > >
>>>>>>>> >
>>>>>>>>
>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>> _______________________________________________
>>>>>>>> Semediawiki-user mailing list
>>>>>>>> [hidden email]
>>>>>>>> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>
>>>>
>>
>
------------------------------------------------------------------------------
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user
Reply | Threaded
Open this post in threaded view
|

Re: Feeling lost with subobjects

Josh King
The only thing I catch I can think of would be performance or a data fail--
i.e. if thousands and thousands of page's worth of data are all being
stored in this one subobject (if it really is like it's own entity), then
perhaps performance would suffer or there's some cap on the amount of data
the subobject can reasonable handle.

This is where it would be great to talk to somehow who understands well how
subobjects talk to the sql database better than myself. :/

-Josh

On Tue, Nov 3, 2015 at 1:30 AM, Simon Heimler <[hidden email]>
wrote:

> Ok, that's interesting.
>
> Actually, I haven't tested all possibilities here and I have
> misinterpreted something. There may be no catch ;).
>
> Maybe some more experienced SMW users can give some more explanations?
>
> Best,
> Simon
>
> 2015-11-03 3:32 GMT+01:00 Josh King <[hidden email]>:
>
>> Hi Simon,
>>
>> Thanks for that extra bit of info.What you're noting was my original take
>> on the reading of the documentation your posting, but replies in the thread
>> had convinced me for some reason that I didn't need the anonymous
>> identifiers. As it stands right now, I'm not quite sure where the
>> collisions would come from?
>>
>> Currently on my site I have multiple pages all using a subobject with the
>> same ID. Each of these pages then queries (to display) the subobject using:
>>
>> {{#ask:
>>   [[-Has subobject::{{FULLPAGENAME}}]]
>>   [[Has subobject name::SubobjectIDName]]
>>   |?Properties to be displayed...
>>   ....
>> }}
>>
>> Where "Has subobject name" is a property I defined. Currently this seems
>> to work and lets me display only the data unique to that page. It's also
>> nice that the subobject gets to keep a nice and tidy name in this way that
>> helps me tell it apart from other uniquely named subobjects also on that
>> page. Your response makes me think there's a catch I'm not seeing though?
>>
>> Thanks,
>> Josh
>>
>> On Fri, Oct 30, 2015 at 1:01 AM, Simon Heimler <[hidden email]>
>> wrote:
>>
>>> Hello Josh,
>>>
>>> the problem with subobject IDs is that they need to be unique throughout
>>> the wiki. The query you're made as an example doesn't make sense in one
>>> point: You're selecting a subobject through an ID AND through an additional
>>> selector. The ID selection is already returning exactly 1 or 0 results.
>>>
>>> Since you usually add subobjects through multiple instance templates,
>>> you've got the problem how to assign each one automatically a new ID -
>>> otherwise you would get collisions. That's why the anonymous identifier (
>>> https://www.semantic-mediawiki.org/wiki/Help:Adding_subobjects#Anonymous_identifier)
>>> makes a lot of sense. In this case, a hash string will be appended to
>>> ensure that the subobject has a unique ID. Please note that changing the
>>> content of the subobject leads to a new hash, so you really can't depend on
>>> selecting it through the ID anyway.
>>>
>>> That's the reason why I've ended up using those two helper properties
>>>
>>> Best,
>>> Simon
>>>
>>>
>>> 2015-10-29 21:22 GMT+01:00 Josh King <[hidden email]>:
>>>
>>>> I can confirm now that the code snippet mentioned above doesn't work;
>>>> Im also inclined to believe through my attempts that theirs no way to query
>>>> on the subobjects ID (which would seem a needed or obvious ability to me so
>>>> maybe im missing it), but Simon's work around of using a labelling property
>>>> works in the meantime for me.
>>>> On Oct 28, 2015 7:18 AM, "Josh King" <[hidden email]> wrote:
>>>>
>>>>> Hi Simon,
>>>>>
>>>>> Thanks for the responses so far. When I asked that previously, I
>>>>> hadn't tried that query yet and now realize I'm not even sure what it would
>>>>> look like in the ask statement. The SMW documentation on this:
>>>>> https://www.semantic-mediawiki.org/wiki/Help:Subobjects_and_queries
>>>>> only seems to offer the ability to do it by page and by some property
>>>>> within the subobject (and not the unique identifier).
>>>>>
>>>>> Are you saying then that a query such as:
>>>>>
>>>>> {{#ask:
>>>>> [[unique-id]]
>>>>> [[-Has subobject::{{FULLPAGENAME}}]]
>>>>> |?YourSubobjectProperty1
>>>>> ...
>>>>> }}
>>>>>
>>>>> would pull all subobjects on FULLPAGENAME that have the id "unique-id"?
>>>>>
>>>>> That would be great for me as nearly all of my pages are done by form
>>>>> (I'll know the ID), but I do like your property workaround also.
>>>>>
>>>>> Thanks,
>>>>> Josh
>>>>>
>>>>> On Wed, Oct 28, 2015 at 12:16 AM, Simon Heimler <
>>>>> [hidden email]> wrote:
>>>>>
>>>>>> Yes, you could also use the unique identified like [[unique-id]] and
>>>>>> query for it directly. The problem is, you need to know that identifier in
>>>>>> order to write the query. It really depends on your use-case / query if you
>>>>>> need those extra properties or not.
>>>>>>
>>>>>> Best,
>>>>>> Simon
>>>>>>
>>>>>> 2015-10-28 4:39 GMT+01:00 Josh King <[hidden email]>:
>>>>>>
>>>>>>> Hi Simon,
>>>>>>>
>>>>>>> That's a good idea. I was just starting to bump into the need for
>>>>>>> this myself as I add multiple subobjects to my page. Can you not query on
>>>>>>> the unique identifier that you can give each subobject though? I thought
>>>>>>> that would be more streamlined than adding extra property data.
>>>>>>> On Oct 26, 2015 2:23 AM, "Simon Heimler" <[hidden email]>
>>>>>>> wrote:
>>>>>>>
>>>>>>>> I'm not sure whether this is best practice, but I ended up adding
>>>>>>>> two helper properties to each subobject I'm using.
>>>>>>>>
>>>>>>>> Something like:
>>>>>>>>
>>>>>>>> {{#subobject:
>>>>>>>>  |Superobject:__FULLPAGENAME__​
>>>>>>>>  |SubobjectType: NameOfTheMultipleInstanceTemplate
>>>>>>>>  |Has number=123
>>>>>>>> }}
>>>>>>>>
>>>>>>>> This allows you to write your queries for subobjects in a much more
>>>>>>>> natural way:
>>>>>>>>
>>>>>>>> [[Superobject:Page A]][[SubobjectType:TemplA]] |?Has number
>>>>>>>>
>>>>>>>> Of course, you could replace the Superobject with an inverse
>>>>>>>> property. The SubobjectType I find very useful, since you can clearly
>>>>>>>> define to only query for those subobject types.
>>>>>>>>
>>>>>>>> Best,
>>>>>>>> Simon
>>>>>>>>
>>>>>>>> 2015-10-25 3:21 GMT+01:00 Josh King <[hidden email]>:
>>>>>>>>
>>>>>>>>> Thank you James-- I had begun to think that I needed the anonymous
>>>>>>>>> identifiers for my subobjects so that multiple pages wouldn't
>>>>>>>>> bloat them,
>>>>>>>>> but now that I understand that subobjects really are stored within
>>>>>>>>> a
>>>>>>>>> subject (instead of floating sneakily in the nether), this all
>>>>>>>>> makes much
>>>>>>>>> more sense and I'll stick with my named identifiers. That solved
>>>>>>>>> all my
>>>>>>>>> questions so thanks again!
>>>>>>>>>
>>>>>>>>> -Josh
>>>>>>>>>
>>>>>>>>> On Sat, Oct 24, 2015 at 6:46 PM, James HK <
>>>>>>>>> [hidden email]>
>>>>>>>>> wrote:
>>>>>>>>>
>>>>>>>>> > Hi,
>>>>>>>>> >
>>>>>>>>> > > If I have multiple pages all using the same subobject template
>>>>>>>>> (with the
>>>>>>>>> > > subobject given some typed out identifier), is the actual data
>>>>>>>>> for all
>>>>>>>>> > > those pages going into that same subobject (as I understand
>>>>>>>>> subobjects
>>>>>>>>> > are
>>>>>>>>> >
>>>>>>>>> > No.
>>>>>>>>> >
>>>>>>>>> > > those pages going into that same subobject (as I understand
>>>>>>>>> subobjects
>>>>>>>>> > are
>>>>>>>>> > > like invisible pages), or are multiple instances of that
>>>>>>>>> subobject being
>>>>>>>>> > > created? For that matter, how could I even see which
>>>>>>>>> subobjects exist on
>>>>>>>>> > my
>>>>>>>>> >
>>>>>>>>> > Each subobject is associated with a "root" subject (a subject
>>>>>>>>> that
>>>>>>>>> > embeds a subobject). Aside from this association, a subobject is
>>>>>>>>> > encoded by a name that corresponds to the data its represents
>>>>>>>>> and is
>>>>>>>>> > addressed internally via SUBJECT#NS#IW#SUBOBJECTNAME.
>>>>>>>>> >
>>>>>>>>> > If two subobjects describe the same thing (we assume they denote
>>>>>>>>> a
>>>>>>>>> > thing with the same data) within the same subject then only one
>>>>>>>>> > subobject is stored. [0].
>>>>>>>>> >
>>>>>>>>> > If two subobjects appear to describe the same thing but are
>>>>>>>>> embedded
>>>>>>>>> > in two different subjects then those subobjects (in connection
>>>>>>>>> with
>>>>>>>>> > the subject) represent two totally different things therefore are
>>>>>>>>> > stored separately and distinct from each other.
>>>>>>>>> >
>>>>>>>>> > Subject FOO with
>>>>>>>>> > {{#subobject:
>>>>>>>>> >  |Has number=123
>>>>>>>>> > }}
>>>>>>>>> >
>>>>>>>>> > is different from
>>>>>>>>> >
>>>>>>>>> > Subject BAR with
>>>>>>>>> > {{#subobject:
>>>>>>>>> >  |Has number=123
>>>>>>>>> > }}
>>>>>>>>> >
>>>>>>>>> > A question such as "Which subject contains [[Has number::123]]"
>>>>>>>>> will
>>>>>>>>> > be answered by:
>>>>>>>>> >
>>>>>>>>> > - FOO#_c869667efa584ce62a07d13723321630
>>>>>>>>> > - BAR#_c869667efa584ce62a07d13723321630
>>>>>>>>> >
>>>>>>>>> > > My major concern though is that if all that data is just going
>>>>>>>>> to one
>>>>>>>>> > > place, then that would quickly get bogged down as my number of
>>>>>>>>> pages
>>>>>>>>> > using
>>>>>>>>> > > it increased.
>>>>>>>>> >
>>>>>>>>> > Each subject (and each subobject) is stored as single row[1] in
>>>>>>>>> the DB
>>>>>>>>> > (depending on above conditions).
>>>>>>>>> >
>>>>>>>>> > > created? For that matter, how could I even see which
>>>>>>>>> subobjects exist on
>>>>>>>>> > my
>>>>>>>>> > > wiki and delete them if needed?
>>>>>>>>> >
>>>>>>>>> > Via `Special:Browse` or as list displayed in `Property:Has
>>>>>>>>> subobject`.
>>>>>>>>> >
>>>>>>>>> > If a subject (== article or page) is deleted all associated
>>>>>>>>> subobjects
>>>>>>>>> > are deleted as well. If you want to remove a specific subobject
>>>>>>>>> then
>>>>>>>>> > you have the remove that particular #subobject call from your
>>>>>>>>> subject.
>>>>>>>>> >
>>>>>>>>> > [0]
>>>>>>>>> >
>>>>>>>>> https://semantic-mediawiki.org/wiki/Help:Adding_subobjects#Conceptional_notes
>>>>>>>>> >
>>>>>>>>> > [1] This statement is a simplification but should help to
>>>>>>>>> clarify the
>>>>>>>>> > issue raised.
>>>>>>>>> >
>>>>>>>>> > Cheers
>>>>>>>>> >
>>>>>>>>> > On 10/24/15, Josh King <[hidden email]> wrote:
>>>>>>>>> > > Update:
>>>>>>>>> > > I think I understand this slightly better now (in the least my
>>>>>>>>> inline
>>>>>>>>> > query
>>>>>>>>> > > to show the subobjects work). By calling my subobject template
>>>>>>>>> within my
>>>>>>>>> > > page, the page now accurately has the special "Has subobject"
>>>>>>>>> property to
>>>>>>>>> > > associate it to the subobject.
>>>>>>>>> > >
>>>>>>>>> > > My question though now is still where is that subobject data
>>>>>>>>> stored?
>>>>>>>>> > >
>>>>>>>>> > > If I have multiple pages all using the same subobject template
>>>>>>>>> (with the
>>>>>>>>> > > subobject given some typed out identifier), is the actual data
>>>>>>>>> for all
>>>>>>>>> > > those pages going into that same subobject (as I understand
>>>>>>>>> subobjects
>>>>>>>>> > are
>>>>>>>>> > > like invisible pages), or are multiple instances of that
>>>>>>>>> subobject being
>>>>>>>>> > > created? For that matter, how could I even see which
>>>>>>>>> subobjects exist on
>>>>>>>>> > my
>>>>>>>>> > > wiki and delete them if needed?
>>>>>>>>> > >
>>>>>>>>> > > My major concern though is that if all that data is just going
>>>>>>>>> to one
>>>>>>>>> > > place, then that would quickly get bogged down as my number of
>>>>>>>>> pages
>>>>>>>>> > using
>>>>>>>>> > > it increased.
>>>>>>>>> > >
>>>>>>>>> > > On Sat, Oct 24, 2015 at 2:40 PM, Josh King <
>>>>>>>>> [hidden email]> wrote:
>>>>>>>>> > >
>>>>>>>>> > >> Hi all,
>>>>>>>>> > >>
>>>>>>>>> > >> I'm attempting to allow my users to take advantage of
>>>>>>>>> multiple instance
>>>>>>>>> > >> sections on a form, but I can't seem to wrap my head around
>>>>>>>>> getting the
>>>>>>>>> > >> subobject data associated with the page the form creates.
>>>>>>>>> > >>
>>>>>>>>> > >> As I understand, the subobject is like it's own page and you
>>>>>>>>> can't
>>>>>>>>> > >> manually define that a page has a subobject-- if this is so,
>>>>>>>>> how can
>>>>>>>>> > that
>>>>>>>>> > >> page be associated with the semantic data in the subobject?
>>>>>>>>> > >>
>>>>>>>>> > >> Right now, my master form embeds the subobject
>>>>>>>>> multiple-instance
>>>>>>>>> > template
>>>>>>>>> > >> in one of it's fields, but I'm not quite sure where exactly
>>>>>>>>> this ends up
>>>>>>>>> > >> passing the information along to.
>>>>>>>>> > >>
>>>>>>>>> > >> Thanks!
>>>>>>>>> > >> Josh
>>>>>>>>> > >>
>>>>>>>>> > >
>>>>>>>>> >
>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>> > > _______________________________________________
>>>>>>>>> > > Semediawiki-user mailing list
>>>>>>>>> > > [hidden email]
>>>>>>>>> > > https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>>>>>>>>> > >
>>>>>>>>> >
>>>>>>>>>
>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>> _______________________________________________
>>>>>>>>> Semediawiki-user mailing list
>>>>>>>>> [hidden email]
>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>
>>>>>
>>>
>>
>
------------------------------------------------------------------------------
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user
Reply | Threaded
Open this post in threaded view
|

Re: Feeling lost with subobjects

Josh King
For the benefit of anyone interested, I did finally find the catch.

As noted by this page:
http://semantic-mediawiki.org/wiki/Examples/Queries/Subobject_to_display_table_rows
use of an anonymous identifier makes sure the subobject data gets passed to
different rows and cells in the table.

Although I really don't understand the mechanics of it, if you name your
subobject (say in a template), all of the information will get smooshed
into one row, even if it looks like you've got multiple rows when doing
your multiple instance template in Semantic Forms.

In fact, you may not even notice it like myself as multiple instance
templates seem to throw the each "data piece" on a new line, possibly
tricking you into thinking you really do have different rows until you try
to sort the table information or investigate the html.

Long story short, best thing to do seems to be something like:

{{#subobject:
 |Has subobject name=SubobjectName
...
}}

Where the identifier after "#subobject:" is intentionally left blank and
"Has subobject name" is a dummy property set so you can query for it as
noted earlier in this thread.

Hope that helps someone out there!
-Josh

On Thu, Nov 5, 2015 at 8:51 PM, Josh King <[hidden email]> wrote:

> The only thing I catch I can think of would be performance or a data
> fail-- i.e. if thousands and thousands of page's worth of data are all
> being stored in this one subobject (if it really is like it's own entity),
> then perhaps performance would suffer or there's some cap on the amount of
> data the subobject can reasonable handle.
>
> This is where it would be great to talk to somehow who understands well
> how subobjects talk to the sql database better than myself. :/
>
> -Josh
>
> On Tue, Nov 3, 2015 at 1:30 AM, Simon Heimler <[hidden email]>
> wrote:
>
>> Ok, that's interesting.
>>
>> Actually, I haven't tested all possibilities here and I have
>> misinterpreted something. There may be no catch ;).
>>
>> Maybe some more experienced SMW users can give some more explanations?
>>
>> Best,
>> Simon
>>
>> 2015-11-03 3:32 GMT+01:00 Josh King <[hidden email]>:
>>
>>> Hi Simon,
>>>
>>> Thanks for that extra bit of info.What you're noting was my original
>>> take on the reading of the documentation your posting, but replies in the
>>> thread had convinced me for some reason that I didn't need the anonymous
>>> identifiers. As it stands right now, I'm not quite sure where the
>>> collisions would come from?
>>>
>>> Currently on my site I have multiple pages all using a subobject with
>>> the same ID. Each of these pages then queries (to display) the subobject
>>> using:
>>>
>>> {{#ask:
>>>   [[-Has subobject::{{FULLPAGENAME}}]]
>>>   [[Has subobject name::SubobjectIDName]]
>>>   |?Properties to be displayed...
>>>   ....
>>> }}
>>>
>>> Where "Has subobject name" is a property I defined. Currently this seems
>>> to work and lets me display only the data unique to that page. It's also
>>> nice that the subobject gets to keep a nice and tidy name in this way that
>>> helps me tell it apart from other uniquely named subobjects also on that
>>> page. Your response makes me think there's a catch I'm not seeing though?
>>>
>>> Thanks,
>>> Josh
>>>
>>> On Fri, Oct 30, 2015 at 1:01 AM, Simon Heimler <[hidden email]>
>>> wrote:
>>>
>>>> Hello Josh,
>>>>
>>>> the problem with subobject IDs is that they need to be unique
>>>> throughout the wiki. The query you're made as an example doesn't make sense
>>>> in one point: You're selecting a subobject through an ID AND through an
>>>> additional selector. The ID selection is already returning exactly 1 or 0
>>>> results.
>>>>
>>>> Since you usually add subobjects through multiple instance templates,
>>>> you've got the problem how to assign each one automatically a new ID -
>>>> otherwise you would get collisions. That's why the anonymous identifier (
>>>> https://www.semantic-mediawiki.org/wiki/Help:Adding_subobjects#Anonymous_identifier)
>>>> makes a lot of sense. In this case, a hash string will be appended to
>>>> ensure that the subobject has a unique ID. Please note that changing the
>>>> content of the subobject leads to a new hash, so you really can't depend on
>>>> selecting it through the ID anyway.
>>>>
>>>> That's the reason why I've ended up using those two helper properties
>>>>
>>>> Best,
>>>> Simon
>>>>
>>>>
>>>> 2015-10-29 21:22 GMT+01:00 Josh King <[hidden email]>:
>>>>
>>>>> I can confirm now that the code snippet mentioned above doesn't work;
>>>>> Im also inclined to believe through my attempts that theirs no way to query
>>>>> on the subobjects ID (which would seem a needed or obvious ability to me so
>>>>> maybe im missing it), but Simon's work around of using a labelling property
>>>>> works in the meantime for me.
>>>>> On Oct 28, 2015 7:18 AM, "Josh King" <[hidden email]> wrote:
>>>>>
>>>>>> Hi Simon,
>>>>>>
>>>>>> Thanks for the responses so far. When I asked that previously, I
>>>>>> hadn't tried that query yet and now realize I'm not even sure what it would
>>>>>> look like in the ask statement. The SMW documentation on this:
>>>>>> https://www.semantic-mediawiki.org/wiki/Help:Subobjects_and_queries
>>>>>> only seems to offer the ability to do it by page and by some property
>>>>>> within the subobject (and not the unique identifier).
>>>>>>
>>>>>> Are you saying then that a query such as:
>>>>>>
>>>>>> {{#ask:
>>>>>> [[unique-id]]
>>>>>> [[-Has subobject::{{FULLPAGENAME}}]]
>>>>>> |?YourSubobjectProperty1
>>>>>> ...
>>>>>> }}
>>>>>>
>>>>>> would pull all subobjects on FULLPAGENAME that have the id
>>>>>> "unique-id"?
>>>>>>
>>>>>> That would be great for me as nearly all of my pages are done by form
>>>>>> (I'll know the ID), but I do like your property workaround also.
>>>>>>
>>>>>> Thanks,
>>>>>> Josh
>>>>>>
>>>>>> On Wed, Oct 28, 2015 at 12:16 AM, Simon Heimler <
>>>>>> [hidden email]> wrote:
>>>>>>
>>>>>>> Yes, you could also use the unique identified like [[unique-id]] and
>>>>>>> query for it directly. The problem is, you need to know that identifier in
>>>>>>> order to write the query. It really depends on your use-case / query if you
>>>>>>> need those extra properties or not.
>>>>>>>
>>>>>>> Best,
>>>>>>> Simon
>>>>>>>
>>>>>>> 2015-10-28 4:39 GMT+01:00 Josh King <[hidden email]>:
>>>>>>>
>>>>>>>> Hi Simon,
>>>>>>>>
>>>>>>>> That's a good idea. I was just starting to bump into the need for
>>>>>>>> this myself as I add multiple subobjects to my page. Can you not query on
>>>>>>>> the unique identifier that you can give each subobject though? I thought
>>>>>>>> that would be more streamlined than adding extra property data.
>>>>>>>> On Oct 26, 2015 2:23 AM, "Simon Heimler" <[hidden email]>
>>>>>>>> wrote:
>>>>>>>>
>>>>>>>>> I'm not sure whether this is best practice, but I ended up adding
>>>>>>>>> two helper properties to each subobject I'm using.
>>>>>>>>>
>>>>>>>>> Something like:
>>>>>>>>>
>>>>>>>>> {{#subobject:
>>>>>>>>>  |Superobject:__FULLPAGENAME__​
>>>>>>>>>  |SubobjectType: NameOfTheMultipleInstanceTemplate
>>>>>>>>>  |Has number=123
>>>>>>>>> }}
>>>>>>>>>
>>>>>>>>> This allows you to write your queries for subobjects in a much
>>>>>>>>> more natural way:
>>>>>>>>>
>>>>>>>>> [[Superobject:Page A]][[SubobjectType:TemplA]] |?Has number
>>>>>>>>>
>>>>>>>>> Of course, you could replace the Superobject with an inverse
>>>>>>>>> property. The SubobjectType I find very useful, since you can clearly
>>>>>>>>> define to only query for those subobject types.
>>>>>>>>>
>>>>>>>>> Best,
>>>>>>>>> Simon
>>>>>>>>>
>>>>>>>>> 2015-10-25 3:21 GMT+01:00 Josh King <[hidden email]>:
>>>>>>>>>
>>>>>>>>>> Thank you James-- I had begun to think that I needed the anonymous
>>>>>>>>>> identifiers for my subobjects so that multiple pages wouldn't
>>>>>>>>>> bloat them,
>>>>>>>>>> but now that I understand that subobjects really are stored
>>>>>>>>>> within a
>>>>>>>>>> subject (instead of floating sneakily in the nether), this all
>>>>>>>>>> makes much
>>>>>>>>>> more sense and I'll stick with my named identifiers. That solved
>>>>>>>>>> all my
>>>>>>>>>> questions so thanks again!
>>>>>>>>>>
>>>>>>>>>> -Josh
>>>>>>>>>>
>>>>>>>>>> On Sat, Oct 24, 2015 at 6:46 PM, James HK <
>>>>>>>>>> [hidden email]>
>>>>>>>>>> wrote:
>>>>>>>>>>
>>>>>>>>>> > Hi,
>>>>>>>>>> >
>>>>>>>>>> > > If I have multiple pages all using the same subobject
>>>>>>>>>> template (with the
>>>>>>>>>> > > subobject given some typed out identifier), is the actual
>>>>>>>>>> data for all
>>>>>>>>>> > > those pages going into that same subobject (as I understand
>>>>>>>>>> subobjects
>>>>>>>>>> > are
>>>>>>>>>> >
>>>>>>>>>> > No.
>>>>>>>>>> >
>>>>>>>>>> > > those pages going into that same subobject (as I understand
>>>>>>>>>> subobjects
>>>>>>>>>> > are
>>>>>>>>>> > > like invisible pages), or are multiple instances of that
>>>>>>>>>> subobject being
>>>>>>>>>> > > created? For that matter, how could I even see which
>>>>>>>>>> subobjects exist on
>>>>>>>>>> > my
>>>>>>>>>> >
>>>>>>>>>> > Each subobject is associated with a "root" subject (a subject
>>>>>>>>>> that
>>>>>>>>>> > embeds a subobject). Aside from this association, a subobject is
>>>>>>>>>> > encoded by a name that corresponds to the data its represents
>>>>>>>>>> and is
>>>>>>>>>> > addressed internally via SUBJECT#NS#IW#SUBOBJECTNAME.
>>>>>>>>>> >
>>>>>>>>>> > If two subobjects describe the same thing (we assume they
>>>>>>>>>> denote a
>>>>>>>>>> > thing with the same data) within the same subject then only one
>>>>>>>>>> > subobject is stored. [0].
>>>>>>>>>> >
>>>>>>>>>> > If two subobjects appear to describe the same thing but are
>>>>>>>>>> embedded
>>>>>>>>>> > in two different subjects then those subobjects (in connection
>>>>>>>>>> with
>>>>>>>>>> > the subject) represent two totally different things therefore
>>>>>>>>>> are
>>>>>>>>>> > stored separately and distinct from each other.
>>>>>>>>>> >
>>>>>>>>>> > Subject FOO with
>>>>>>>>>> > {{#subobject:
>>>>>>>>>> >  |Has number=123
>>>>>>>>>> > }}
>>>>>>>>>> >
>>>>>>>>>> > is different from
>>>>>>>>>> >
>>>>>>>>>> > Subject BAR with
>>>>>>>>>> > {{#subobject:
>>>>>>>>>> >  |Has number=123
>>>>>>>>>> > }}
>>>>>>>>>> >
>>>>>>>>>> > A question such as "Which subject contains [[Has number::123]]"
>>>>>>>>>> will
>>>>>>>>>> > be answered by:
>>>>>>>>>> >
>>>>>>>>>> > - FOO#_c869667efa584ce62a07d13723321630
>>>>>>>>>> > - BAR#_c869667efa584ce62a07d13723321630
>>>>>>>>>> >
>>>>>>>>>> > > My major concern though is that if all that data is just
>>>>>>>>>> going to one
>>>>>>>>>> > > place, then that would quickly get bogged down as my number
>>>>>>>>>> of pages
>>>>>>>>>> > using
>>>>>>>>>> > > it increased.
>>>>>>>>>> >
>>>>>>>>>> > Each subject (and each subobject) is stored as single row[1] in
>>>>>>>>>> the DB
>>>>>>>>>> > (depending on above conditions).
>>>>>>>>>> >
>>>>>>>>>> > > created? For that matter, how could I even see which
>>>>>>>>>> subobjects exist on
>>>>>>>>>> > my
>>>>>>>>>> > > wiki and delete them if needed?
>>>>>>>>>> >
>>>>>>>>>> > Via `Special:Browse` or as list displayed in `Property:Has
>>>>>>>>>> subobject`.
>>>>>>>>>> >
>>>>>>>>>> > If a subject (== article or page) is deleted all associated
>>>>>>>>>> subobjects
>>>>>>>>>> > are deleted as well. If you want to remove a specific subobject
>>>>>>>>>> then
>>>>>>>>>> > you have the remove that particular #subobject call from your
>>>>>>>>>> subject.
>>>>>>>>>> >
>>>>>>>>>> > [0]
>>>>>>>>>> >
>>>>>>>>>> https://semantic-mediawiki.org/wiki/Help:Adding_subobjects#Conceptional_notes
>>>>>>>>>> >
>>>>>>>>>> > [1] This statement is a simplification but should help to
>>>>>>>>>> clarify the
>>>>>>>>>> > issue raised.
>>>>>>>>>> >
>>>>>>>>>> > Cheers
>>>>>>>>>> >
>>>>>>>>>> > On 10/24/15, Josh King <[hidden email]> wrote:
>>>>>>>>>> > > Update:
>>>>>>>>>> > > I think I understand this slightly better now (in the least
>>>>>>>>>> my inline
>>>>>>>>>> > query
>>>>>>>>>> > > to show the subobjects work). By calling my subobject
>>>>>>>>>> template within my
>>>>>>>>>> > > page, the page now accurately has the special "Has subobject"
>>>>>>>>>> property to
>>>>>>>>>> > > associate it to the subobject.
>>>>>>>>>> > >
>>>>>>>>>> > > My question though now is still where is that subobject data
>>>>>>>>>> stored?
>>>>>>>>>> > >
>>>>>>>>>> > > If I have multiple pages all using the same subobject
>>>>>>>>>> template (with the
>>>>>>>>>> > > subobject given some typed out identifier), is the actual
>>>>>>>>>> data for all
>>>>>>>>>> > > those pages going into that same subobject (as I understand
>>>>>>>>>> subobjects
>>>>>>>>>> > are
>>>>>>>>>> > > like invisible pages), or are multiple instances of that
>>>>>>>>>> subobject being
>>>>>>>>>> > > created? For that matter, how could I even see which
>>>>>>>>>> subobjects exist on
>>>>>>>>>> > my
>>>>>>>>>> > > wiki and delete them if needed?
>>>>>>>>>> > >
>>>>>>>>>> > > My major concern though is that if all that data is just
>>>>>>>>>> going to one
>>>>>>>>>> > > place, then that would quickly get bogged down as my number
>>>>>>>>>> of pages
>>>>>>>>>> > using
>>>>>>>>>> > > it increased.
>>>>>>>>>> > >
>>>>>>>>>> > > On Sat, Oct 24, 2015 at 2:40 PM, Josh King <
>>>>>>>>>> [hidden email]> wrote:
>>>>>>>>>> > >
>>>>>>>>>> > >> Hi all,
>>>>>>>>>> > >>
>>>>>>>>>> > >> I'm attempting to allow my users to take advantage of
>>>>>>>>>> multiple instance
>>>>>>>>>> > >> sections on a form, but I can't seem to wrap my head around
>>>>>>>>>> getting the
>>>>>>>>>> > >> subobject data associated with the page the form creates.
>>>>>>>>>> > >>
>>>>>>>>>> > >> As I understand, the subobject is like it's own page and you
>>>>>>>>>> can't
>>>>>>>>>> > >> manually define that a page has a subobject-- if this is so,
>>>>>>>>>> how can
>>>>>>>>>> > that
>>>>>>>>>> > >> page be associated with the semantic data in the subobject?
>>>>>>>>>> > >>
>>>>>>>>>> > >> Right now, my master form embeds the subobject
>>>>>>>>>> multiple-instance
>>>>>>>>>> > template
>>>>>>>>>> > >> in one of it's fields, but I'm not quite sure where exactly
>>>>>>>>>> this ends up
>>>>>>>>>> > >> passing the information along to.
>>>>>>>>>> > >>
>>>>>>>>>> > >> Thanks!
>>>>>>>>>> > >> Josh
>>>>>>>>>> > >>
>>>>>>>>>> > >
>>>>>>>>>> >
>>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>>> > > _______________________________________________
>>>>>>>>>> > > Semediawiki-user mailing list
>>>>>>>>>> > > [hidden email]
>>>>>>>>>> > > https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>>>>>>>>>> > >
>>>>>>>>>> >
>>>>>>>>>>
>>>>>>>>>> ------------------------------------------------------------------------------
>>>>>>>>>> _______________________________________________
>>>>>>>>>> Semediawiki-user mailing list
>>>>>>>>>> [hidden email]
>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>
>>>>>>
>>>>
>>>
>>
>
------------------------------------------------------------------------------
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user