[Mulgara-dev] simple app for functional groupings
Paul Gearon
gearon at ieee.org
Wed Mar 12 18:53:29 UTC 2008
On Mar 12, 2008, at 12:39 PM, William Mills wrote:
> Explanation of point one below... if I define the role "webservers"
> having the members (www[1-2,4].mulgara.org, www.tucana.org), then I
> want to be able to retrieve
>
> 1) the short definition of the role, which is
> (www[1-2,4].mulgara.org, www.tucana.org)
> 2) enumerate the list of hosts with that role, which is
> (www1.mulgara.org, www2.mulgara.org, www4.mulgara.org, www.tucana.org)
>
> The problem comes with the reverse mapping of hsotname to role....
>
> I had thought about perhaps making the relationship to the role be
> the machine expression/regexp, so something like:
>
> (<rolename:webservers>, <machineregexp:www[1-2,4].mulgara.org>,
> "www1.mulgara.org")
This doesn't make me comfortable at all. Sure, it's legal, but
conceptually it doesn't quite work for me. It's almost as if you have
webservers appearing in an OWL class that has a restriction on the
"contains" predicate to the list defined by your pattern. If you are
going down this path, then I'd rather see a different predicate, which
in turn was related to that name-pattern (whether by OWL restriction,
or some other mechanism).
> But it shound like you are suggesting that the better way to
> structure this is:
>
> (<rolename:webservers>, <primitives:contains>,
> "www[1-2,4].mulgara.org")
> (<machineregexp:www[1-2,4].mulgara.org>, <primitives:contains>,
> "www1.mulgara.org")
Sort of. I wouldn't use primitives:contains for both purposes like
that. I'd probably have something like:
(<rolename:webservers>, <primitives:containsPattern>,
<machineregexp:www[1-2,4].mulgara.org>)
(<machineregexp:www[1-2,4].mulgara.org>, <primitives:describes>,
"www1.mulgara.org")
(<machineregexp:www[1-2,4].mulgara.org>, <primitives:describes>,
"www2.mulgara.org")
(<machineregexp:www[1-2,4].mulgara.org>, <primitives:describes>,
"www4.mulgara.org")
(<rolename:webservers>, <primitives:contains>, "www1.mulgara.org")
The differences here are that the object in the first line is
identical to the subjects in the next 3. Also, lines 2-5 can be
deduced from line 1 (though not via OWL). If primitives:contains were
restricted on the class that rolename:webservers belongs to, then you
could confirm that line 5 was consistent with line 1, but that's all
the RDF/OWL automation I can see here. Maybe SWRL has a regex
engine? :-)
> It all gets more complicated when a role inherits/contains another
> role definition, like (<rolename:webservers>, <primitives:inherits>,
> "imageservers"), or I suppose that could be (<rolename:webservers>,
> <primitives:contains>, "rolename:imageservers") right?
Be liberal with your predicates. Don't keep using the same ones all
the time. If you really want to group them together, then have all
your predicates be rdfs:subPropertyOf the main property.
> ----- Original Message ----
> From: Paul Gearon <gearon at ieee.org>
> To: Mulgara Developers <mulgara-dev at mulgara.org>
> Sent: Wednesday, March 12, 2008 9:40:58 AM
> Subject: Re: [Mulgara-dev] simple app for functional groupings
>
> On Mar 10, 2008, at 7:49 PM, William Mills wrote:
>
>> I have a relatively simple app I want to play with in Mulgara, which
>> is doing functional groupings of machines. In it I have:
>>
>> roles: a named grouping of other roles, machine expressions,
>> and machine names.
>>
>> machine expressions: a regexp like string used to define a list
>> of hostnames, i.e. www{1-4,6}.mulgara.org whih identifies 5 hosts.
>>
>> machine names: a simple machine name like
>> www1.mulgara.org
>>
>> What is the best (if there is one) RDF way to structure this so
>> that I can easily get
>>
>> 1) the short definition of a role, i.e. the minimal set of roles,
>> machine expressions, and machine names
>>
>> 2) the full list of host names contained by a role
>>
>> 3) for a given host get the list of roles it is a member of.
>>
>> There are several ways to structure this, and I'm not sure of the
>> pitfalls yet.
>
> The main thing you want to do is to make sure you have a relationship
> (ie. a predicate) for everything you want to search on. For instance,
> item 3 would want some sort of memberOf property to each role a host
> belongs to. It doesn't matter which direction it's pointing in, so
> you could have an inverse predicate like hasMember instead, with no
> issues.
>
> Point 2 will require another sort of membership predicate between
> roles and their members. And point 1 I can't say, because I don't
> really understand the question. :-)
>
> Regards,
> Paul
> _______________________________________________
> Mulgara-dev mailing list
> Mulgara-dev at mulgara.org
> http://mulgara.org/mailman/listinfo/mulgara-dev
>
>
>
> _______________________________________________
> Mulgara-dev mailing list
> Mulgara-dev at mulgara.org
> http://mulgara.org/mailman/listinfo/mulgara-dev
More information about the Mulgara-dev
mailing list