Selecting SMW-Properties based on SMW-Properties

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

Selecting SMW-Properties based on SMW-Properties

Bjoern Decker
Hello,

I am currently evaluating to use Semantic Media Wiki as to document a graph data model.

I currently have nodes and relationship, that have properties. Nodes, relationships and properties of them are represented as separate pages with attributes. What I want is to have a table on the page Node1 that contains all the attributes of the corresponding properties.

So the example would be as follows:
Page Node1:
[[hasProperty:id]]
[[hasProperty:comment]]

[[Category:Node]]

Page Id:
[[hasType::Text]]
[[hasDescription::Contains id, unique within the whole graph]]
[[isUnique::true]]
[[isOptional::false]]

[[Category:Property]]

Page Comment:
[[hasType::Text]]
[[hasDescription::Comment about the node]]
[[isUnique::false]]
[[isOptional::true]]

[[Category: Property]]

Page Not Related Property:
[[hasType::Text]]
[[hasDescription::This property should NOT be shown]]
[[isUnique::false]]
[[isOptional::true]]

[[Category: Property]]



I tried the following that did not work:
{{#ask:
[[Category:Property]]
[[<q> [[Object]] |?has_attribute</q>]]
|?hasName
|?hasDescription
|?hasType
|format=debug
}}


The current workaround I found so far is  to specify the related nodes in the property page (maybe using a subobject, to have the whole information in one page)
Page Comment:
[[hasNode::Node1]]
[[hasType::Text]]
[[hasDescription::Comment about the node]]
[[isUnique::false]]
[[isOptional::true]]

[[Category: Property]]

However, my hope is that I could use the representation mentioned in the beginning.


If you need further information - e.g. a sandbox example, let me know.

Thanks in advance.


Best wishes

Björn


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

Re: Selecting SMW-Properties based on SMW-Properties

Krabina Bernhard
Hi Bjoern,

I don't have much experience with subqueries, but this does not look right:

[[Object]] |?has_attribute

What is [[Object]]? And also your attribute has_attribute does not show in your data structure...

What you put in the subquery between <q> and </q> must be a coorrect query. And I also think it must not be
[[<q> [[Object]] |?has_attribute</q>]]
but
[[some Property::<q>some other query</q>]]

cheers,
Bernhard

[1] https://www.semantic-mediawiki.org/wiki/Help:Selecting_pages

----- Am 22. Jun 2017 um 11:09 schrieb Bjoern Decker [hidden email]:

> Hello,
>
> I am currently evaluating to use Semantic Media Wiki as to document a graph data
> model.
>
> I currently have nodes and relationship, that have properties. Nodes,
> relationships and properties of them are represented as separate pages with
> attributes. What I want is to have a table on the page Node1 that contains all
> the attributes of the corresponding properties.
>
> So the example would be as follows:
> Page Node1:
> [[hasProperty:id]]
> [[hasProperty:comment]]
>
> [[Category:Node]]
>
> Page Id:
> [[hasType::Text]]
> [[hasDescription::Contains id, unique within the whole graph]]
> [[isUnique::true]]
> [[isOptional::false]]
>
> [[Category:Property]]
>
> Page Comment:
> [[hasType::Text]]
> [[hasDescription::Comment about the node]]
> [[isUnique::false]]
> [[isOptional::true]]
>
> [[Category: Property]]
>
> Page Not Related Property:
> [[hasType::Text]]
> [[hasDescription::This property should NOT be shown]]
> [[isUnique::false]]
> [[isOptional::true]]
>
> [[Category: Property]]
>
>
>
> I tried the following that did not work:
> {{#ask:
> [[Category:Property]]
> [[<q> [[Object]] |?has_attribute</q>]]
>|?hasName
>|?hasDescription
>|?hasType
>|format=debug
> }}
>
>
> The current workaround I found so far is  to specify the related nodes in the
> property page (maybe using a subobject, to have the whole information in one
> page)
> Page Comment:
> [[hasNode::Node1]]
> [[hasType::Text]]
> [[hasDescription::Comment about the node]]
> [[isUnique::false]]
> [[isOptional::true]]
>
> [[Category: Property]]
>
> However, my hope is that I could use the representation mentioned in the
> beginning.
>
>
> If you need further information - e.g. a sandbox example, let me know.
>
> Thanks in advance.
>
>
> Best wishes
>
> Björn
>
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Semediawiki-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/semediawiki-user

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

Re: Selecting SMW-Properties based on SMW-Properties

Bjoern Decker
Hello,

and first of all thanks a lot for the support.
As James pointed out, there is a Bug in my Example.
However, meanwhile I was able to find a solution using Inverse Properties
https://www.semantic-mediawiki.org/wiki/Help:Inverse_properties

Here is the correction / solution

Page Node1:
[[hasProperty::id]]
[[hasProperty::comment]]

[[Category:Node]]

Page Id:
[[Has type::Text]]
[[hasName::id]]
[[hasDescription::Contains id, unique within the whole graph]]
[[isUnique::true]]
[[isOptional::false]]

[[Category:Property]]

Page Comment:
[[Has type::Text]]
[[hasName::comment]]
[[hasDescription::Comment about the node]]
[[isUnique::false]]
[[isOptional::true]]

[[Category: Property]]

Page Not Related Property:
[[Has type::Text]]
[[hasName::Whatever]]
[[hasDescription::This property should NOT be shown]]
[[isUnique::false]]
[[isOptional::true]]

[[Category: Property]]

------ Query

{{#ask:
[[-hasProperty::Object]]
|?hasName
|?hasDescription
|?isUnique
|?isOptional
}}

The Minus before hasProperty does the trick.
I cannot create a sandbox right now since I do not have the permission yet.

Best wishes and thanks for the quick response.

Best wishes

Björn



-----Original Message-----
From: Krabina Bernhard [mailto:[hidden email]]
Sent: Donnerstag, 22. Juni 2017 15:03
To: Bjoern Decker <[hidden email]>
Cc: semediawiki-user <[hidden email]>
Subject: Re: [Semediawiki-user] Selecting SMW-Properties based on SMW-Properties

Hi Bjoern,

I don't have much experience with subqueries, but this does not look right:

[[Object]] |?has_attribute

What is [[Object]]? And also your attribute has_attribute does not show in your data structure...

What you put in the subquery between <q> and </q> must be a coorrect query. And I also think it must not be [[<q> [[Object]] |?has_attribute</q>]] but [[some Property::<q>some other query</q>]]

cheers,
Bernhard

[1] https://www.semantic-mediawiki.org/wiki/Help:Selecting_pages

----- Am 22. Jun 2017 um 11:09 schrieb Bjoern Decker [hidden email]:

> Hello,
>
> I am currently evaluating to use Semantic Media Wiki as to document a
> graph data model.
>
> I currently have nodes and relationship, that have properties. Nodes,
> relationships and properties of them are represented as separate pages
> with attributes. What I want is to have a table on the page Node1 that
> contains all the attributes of the corresponding properties.
>
> So the example would be as follows:
> Page Node1:
> [[hasProperty:id]]
> [[hasProperty:comment]]
>
> [[Category:Node]]
>
> Page Id:
> [[hasType::Text]]
> [[hasDescription::Contains id, unique within the whole graph]]
> [[isUnique::true]] [[isOptional::false]]
>
> [[Category:Property]]
>
> Page Comment:
> [[hasType::Text]]
> [[hasDescription::Comment about the node]] [[isUnique::false]]
> [[isOptional::true]]
>
> [[Category: Property]]
>
> Page Not Related Property:
> [[hasType::Text]]
> [[hasDescription::This property should NOT be shown]]
> [[isUnique::false]] [[isOptional::true]]
>
> [[Category: Property]]
>
>
>
> I tried the following that did not work:
> {{#ask:
> [[Category:Property]]
> [[<q> [[Object]] |?has_attribute</q>]]
>|?hasName
>|?hasDescription
>|?hasType
>|format=debug
> }}
>
>
> The current workaround I found so far is  to specify the related nodes
> in the property page (maybe using a subobject, to have the whole
> information in one
> page)
> Page Comment:
> [[hasNode::Node1]]
> [[hasType::Text]]
> [[hasDescription::Comment about the node]] [[isUnique::false]]
> [[isOptional::true]]
>
> [[Category: Property]]
>
> However, my hope is that I could use the representation mentioned in
> the beginning.
>
>
> If you need further information - e.g. a sandbox example, let me know.
>
> Thanks in advance.
>
>
> Best wishes
>
> Björn
>
>
> ----------------------------------------------------------------------
> -------- Check out the vibrant tech community on one of the world's
> most engaging tech sites, Slashdot.org! http://sdm.link/slashdot 
> _______________________________________________
> Semediawiki-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user
Loading...