Show properties of a subobject's parent page

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

Show properties of a subobject's parent page

Krabina Bernhard
Hi,

in the help page about subobjects and queries there is a section called "Show properties of a subobject's parent page" [1]

This information seems to be incorrect. I did not manage to to that in my wiki. Also the example page seems to be broken [2].

Does anybody with a better understanding of subobjects know how to fix this?

cheers,
Bernhard

[1] https://www.semantic-mediawiki.org/wiki/Help:Subobjects_and_queries
[2] https://www.semantic-mediawiki.org/wiki/Examples/Queries/Use_subobject_with_template


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

Re: Show properties of a subobject's parent page

Phil Legault-2
Having an issue with this is well

I want to be able to combine subobject properties with parent page properties.


The only way I can do that is with linked wiki fuseki server and SPARQL query like.

{{#sparql:
PREFIX property:<http://server.com/index.php/Special:URIResolver/Property-3A>
PREFIX swivt:<http://semantic-mediawiki.org/swivt/1.0#>
PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT ?supported_by ?Subcategory ?name ?version ?technology_name ?owner ?contact ?publication_date ?publication_status ?support_status ?manufacturer ?start_date ?end_date
WHERE
{
 ?s ?p ?sub .
            ?cat rdfs:label ?Category .
            ?cat rdfs:label "Technology" .
            FILTER(CONTAINS(STR(?cat), "Category")) .
            ?sub rdfs:subClassOf ?cat .
            ?sub rdfs:label ?Subcategory .
 ?s property:Has_Name ?name .
  ?s property:Has_subobject ?subobject .
  ?subobject property:Has_Version ?version .
  ?subobject property:Technology_Name ?technology_name .
  ?subobject property:Has_Support_Status ?support_status .
  ?subobject property:Has_Start_Date ?start_date .
   ?subobject property:Has_End_Date ?end_date .
   ?subobject property:Supported_By ?supported_by .
    ?s property:OwnedBy ?owner.
    ?s property:PublicationDate ?publication_date .
    ?s property:PublicationStatus ?publication_status .
    ?s property:ManufacturedBy ?manufacturer.
  OPTIONAL {
    ?s property:Contact ?contact.
  }
}
ORDER BY ?name
LIMIT 1000000
|endpoint=http://server:8080/dev/sparql}}





I tried the template query option like


{{#ask: [[YourSubobjectProperty::+]]
|?YourSubobjectProperty1
|?YourSubobjectProperty2
|format=template
|template=YourTemplate
}}

The results break up into separate tables, very strange.



________________________________
From: Krabina Bernhard <[hidden email]>
Sent: Friday, December 16, 2016 9:47 AM
To: semediawiki-user
Subject: [Semediawiki-user] Show properties of a subobject's parent page

Hi,

in the help page about subobjects and queries there is a section called "Show properties of a subobject's parent page" [1]

This information seems to be incorrect. I did not manage to to that in my wiki. Also the example page seems to be broken [2].

Does anybody with a better understanding of subobjects know how to fix this?

cheers,
Bernhard

[1] https://www.semantic-mediawiki.org/wiki/Help:Subobjects_and_queries
[https://www.semantic-mediawiki.org/w/assets/SMW-logo.png]<https://www.semantic-mediawiki.org/wiki/Help:Subobjects_and_queries>

Help:Subobjects and queries - semantic-mediawiki.org<https://www.semantic-mediawiki.org/wiki/Help:Subobjects_and_queries>
www.semantic-mediawiki.org
This help page describes how to query for subobject after they were added to your wiki. Show all subobjects of a page. Using #subobject does not print out anything on ...



[2] https://www.semantic-mediawiki.org/wiki/Examples/Queries/Use_subobject_with_template
[https://www.semantic-mediawiki.org/w/assets/SMW-logo.png]<https://www.semantic-mediawiki.org/wiki/Examples/Queries/Use_subobject_with_template>

Examples/Queries/Use subobject with template - semantic-mediawiki.org<https://www.semantic-mediawiki.org/wiki/Examples/Queries/Use_subobject_with_template>
www.semantic-mediawiki.org





------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user
Semediawiki-user Info Page - SourceForge<https://lists.sourceforge.net/lists/listinfo/semediawiki-user>
lists.sourceforge.net
To see the collection of prior postings to the list, visit the Semediawiki-user Archives. Using Semediawiki-user: To post a message to all the list ...



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

Re: Show properties of a subobject's parent page

Eggleston, Gabriel (NIH/NHGRI) [C]
I don't know SPARQL so I'm not 100% sure how to interpret what you want,
but the template option is working for me in a situation where my query
matches both pages and subobjects. I'm using the additional
"introtemplate=" and "outrotemplate=" parameters to open and close the
table - I think this is what keeps it all in one table, because they are
each only included once in the output.

My "Has responsible person" property below, if not set in the subobject,
is displayed from the parent page.

(This is all on MW 1.23 and SMW 2.4.3.)

This is the query (not including "##"):
##
{{#ask: [[Has IP::~{{{1}}}]] [[:+]]
|?Has hostname=Device
|?#=DevicePlain
|?Has IP=IP
|?Has responsible person=Responsible
|?Has function=Notes
|format=template
|template=IP address list entry
|introtemplate=IP address list header
|outrotemplate=IP address list footer
|named args=yes
|sort=Has IP
|limit=10000
}}
##

This is "Template:IP address list header":
##
{| class="wikitable sortable"
! IP Address !! Device !! Responsible !! Notes
##

This is "Template:IP address list footer":
##
|}
##

This is "Template:IP address list entry":
##
|-
| {{{?IP}}} || {{{?Device}}} || {{#if: {{{?Responsible|}}} |
{{{?Responsible}}} | {{#ask: [[Has subobject::{{{?DevicePlain}}}]] |
?Has responsible person= | mainlabel=- }} }} || {{{?Notes}}}
##


--
Gabriel Eggleston
NHGRI Contractor – CSRA

On 12/16/2016 11:16 AM, Phil Legault wrote:

> Having an issue with this is well
>
> I want to be able to combine subobject properties with parent page properties.
>
>
> The only way I can do that is with linked wiki fuseki server and SPARQL query like.
>
> {{#sparql:
> PREFIX property:<http://server.com/index.php/Special:URIResolver/Property-3A>
> PREFIX swivt:<http://semantic-mediawiki.org/swivt/1.0#>
> PREFIX rdfs:<http://www.w3.org/2000/01/rdf-schema#>
> PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
> SELECT ?supported_by ?Subcategory ?name ?version ?technology_name ?owner ?contact ?publication_date ?publication_status ?support_status ?manufacturer ?start_date ?end_date
> WHERE
> {
>  ?s ?p ?sub .
>             ?cat rdfs:label ?Category .
>             ?cat rdfs:label "Technology" .
>             FILTER(CONTAINS(STR(?cat), "Category")) .
>             ?sub rdfs:subClassOf ?cat .
>             ?sub rdfs:label ?Subcategory .
>  ?s property:Has_Name ?name .
>   ?s property:Has_subobject ?subobject .
>   ?subobject property:Has_Version ?version .
>   ?subobject property:Technology_Name ?technology_name .
>   ?subobject property:Has_Support_Status ?support_status .
>   ?subobject property:Has_Start_Date ?start_date .
>    ?subobject property:Has_End_Date ?end_date .
>    ?subobject property:Supported_By ?supported_by .
>     ?s property:OwnedBy ?owner.
>     ?s property:PublicationDate ?publication_date .
>     ?s property:PublicationStatus ?publication_status .
>     ?s property:ManufacturedBy ?manufacturer.
>   OPTIONAL {
>     ?s property:Contact ?contact.
>   }
> }
> ORDER BY ?name
> LIMIT 1000000
> |endpoint=http://server:8080/dev/sparql}}
>
>
>
>
>
> I tried the template query option like
>
>
> {{#ask: [[YourSubobjectProperty::+]]
> |?YourSubobjectProperty1
> |?YourSubobjectProperty2
> |format=template
> |template=YourTemplate
> }}
>
> The results break up into separate tables, very strange.
>
>
>
> ________________________________
> From: Krabina Bernhard <[hidden email]>
> Sent: Friday, December 16, 2016 9:47 AM
> To: semediawiki-user
> Subject: [Semediawiki-user] Show properties of a subobject's parent page
>
> Hi,
>
> in the help page about subobjects and queries there is a section called "Show properties of a subobject's parent page" [1]
>
> This information seems to be incorrect. I did not manage to to that in my wiki. Also the example page seems to be broken [2].
>
> Does anybody with a better understanding of subobjects know how to fix this?
>
> cheers,
> Bernhard
>
> [1] https://www.semantic-mediawiki.org/wiki/Help:Subobjects_and_queries
> [https://www.semantic-mediawiki.org/w/assets/SMW-logo.png]<https://www.semantic-mediawiki.org/wiki/Help:Subobjects_and_queries>
>
> Help:Subobjects and queries - semantic-mediawiki.org<https://www.semantic-mediawiki.org/wiki/Help:Subobjects_and_queries>
> www.semantic-mediawiki.org
> This help page describes how to query for subobject after they were added to your wiki. Show all subobjects of a page. Using #subobject does not print out anything on ...
>
>
>
> [2] https://www.semantic-mediawiki.org/wiki/Examples/Queries/Use_subobject_with_template
> [https://www.semantic-mediawiki.org/w/assets/SMW-logo.png]<https://www.semantic-mediawiki.org/wiki/Examples/Queries/Use_subobject_with_template>
>
> Examples/Queries/Use subobject with template - semantic-mediawiki.org<https://www.semantic-mediawiki.org/wiki/Examples/Queries/Use_subobject_with_template>
> www.semantic-mediawiki.org
>
>
>
>
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> Semediawiki-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
> Semediawiki-user Info Page - SourceForge<https://lists.sourceforge.net/lists/listinfo/semediawiki-user>
> lists.sourceforge.net
> To see the collection of prior postings to the list, visit the Semediawiki-user Archives. Using Semediawiki-user: To post a message to all the list ...
>
>
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> Semediawiki-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>

------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/intel
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user
Reply | Threaded
Open this post in threaded view
|

Re: Show properties of a subobject's parent page

lbillett
In reply to this post by Krabina Bernhard
Krabina Bernhard wrote
in the help page about subobjects and queries there is a section called "Show properties of a subobject's parent page"

This information seems to be incorrect. I did not manage to to that in my wiki. Also the example page seems to be broken.

Does anybody with a better understanding of subobjects know how to fix this?
Sandbox example here [1]. Seems to work as expected (though, I may not understand what the issue is). Documentation probably just needs some tweaks. It could be made more clear what it's trying to demonstrate.

lpab

[1] https://sandbox.semantic-mediawiki.org/wiki/Property_of_Subobject_Parent