XML for Analysis (XML/A) format of member names? - olap

I have two different XML/A providers, Mondrian and icCube. The tuples for a time dimension contain the unique name for the member, but the format of the member name is different:
Mondrian:
<UName>[Time].[2004].[QTR2].[Apr]</UName>
<Caption>Apr</Caption>
[Time] is the name of the hierarchy
[2004] is the name of the ancestor at the Year level
[QTR2] is the name of the ancestor at the Quarter level
[Apr] is the local name of the member at the Month level
icCube:
<UName>[Time].[Calendar].[Month].&[Jun 2010]</UName>
<Caption>Jun 2010</Caption>
[Time] is the name of the dimension
[Calendar] is the the name of the
hierarchy
[Month] is the name of the level
[Jun 2010] is the name of
the month member.
(I don't know why the ampersands are there)
My question is, is there any recommended, preferably standard way to figure out how the member names are formatted?
The reason I want to know this is when I render the result in a Pivot table, the captions for the members will usually end up as labels on the headers of the pivot table. But since the captions may not be unique, it is desirable to also produce labels of the "ancestor" members, because together they do identify the member uniquely.
In my example, I could use the parts of the member unique name to do this, but in ic cube not,since the member u name is structured differently.
I have 2 questions:
1) How can I tell beforehand what format the XML/A provider will use to identify the members?
2) What would be the recommended way in ic cube to produce the labels for the ancestor members?
UPDATE:
Luc Boudreau informed me that the ampersand indicates "key notation" - it designates the member key rather than its name. Thanks Luc!

The meaning of unique names in MDX is a string that guarantees that it defines a unique MDX entity when parsed. There is no possible collision with another MDX entity. The way to write it depends on the XMLA provider. Even though it's 'unique' there are multiple ways creating it, each server chooses its way.
Never mind, a query written in one server will work in another as both 'unique' names are correctly parsed.
& amp; stands for &
Our advise, the client code should not rely on the format of the unique names.
That being said, if you need parent "names", you should retrieve them explicitly using the "Parent" function and/or as a calculated measure retrieving the name/caption property.
Hope that helps.

Related

Using shacl to validate a property that has at most one value in its properties

I'm trying to create a shacl based on the ontology that my organization is developing (in dutch): https://wegenenverkeer.data.vlaanderen.be/
The objects described have attributes (properties), that have a specified datatype. The datatype can a primitive (like string or decimal) or complex, which means the property will have properties itself (nested properties). For example: an asset object A will have an attribute assetId which is a complex datatype DtcIdentificator, which consists of two properties itself. I have succesfully created a shacl that validates objects by creating multiple shapes and nesting them.
I now run into the problem of what we call union datatypes. These are a special kind of complex datatypes. They are still nested datatypes: the attribute with the union datatypes will have multiple properties but only exactly zero or one of those properties may have a value. If the attribute has 2 properties with values, it is invalid. How can I create such a constraint in shacl?
Example (in dutch): https://wegenenverkeer.data.vlaanderen.be/doc/implementatiemodel/union-datatypes/#Afmeting%20verkeersbord
A traffic sign (Verkeersbord, see https://wegenenverkeer.data.vlaanderen.be/doc/implementatiemodel/signalisatie/#Verkeersbord) can have a property afmeting (size) of the datatype DtuAfmetingVerkeersbord.
If an asset A of this type would exist, I could define its size as (in dotnotation):
A.afmeting.rond.waarde = 700
-or-
A.afmeting.driehoekig.waarde = 400
Both are valid ways of using the afmeting property, however, if they are both used for the same object, this becomes invalid, as only one property of A.afmeting may have a value.
I have tried using the union constraint in shacl, but soon found out that that has nothing to do with what we call "union datatypes"
I think the reason you are struggling is because this kind of problem is usually modelled differently. Basically you have different types of Traffic signs and these signs can have measurements. With the model as you described, A.afmeting.rond.waarde captures 2 ideas using 1 property: (a) the type and (b) the size. From your question, this seems to be the intend. However, this is usually not how this kind of problem is addressed.
A more intuitive design is for Traffic sign to have 2 different properties: (a) type and (b) a measurement. The Traffic sign types are achthoekig, driehoekig, etc. Then you can use SHACL to check that a traffic sign has either both or no properties for a traffic sign.

Finding all entity names from deprecated freebase

I'm training a few Machine learning models that represent words as vectors, using freebase as training data. Since the API has been deprecated, I'm working with raw freebase dump, which is now a list of 3.1 billion triples, containing more than 500 million distinct entities (subject/object), and I'd like to reduce this number.
I would like to remove all triples which simply denote names of subjects so that only triples containing MIDs remain. However, I've found multiple possible predicates that define the 'name' of an entity.
i) common.notable_for.display_name
ii) type.object.name
iii) /rdf-schema#label
I have 3 questions :
a) Is there any difference between the above predicates?
b) Are there any additional predicates which also describe the names of entities?
c) Apart from the triple where a name is defined, does the name ever appear in other triples, instead of the MID?
Thank you for your help!
You should only concentrate on the type.object.name that's the schema property holding the topic's name.
The /rdf-schema#label is equalization, it is not part of the freebase schema.
The common.notable_for.display_name description is: "Localized/gender appropriate display name for the notable object.", it is also a property within a CVT (compound value type) and it holds different type of information: "of all types that a topic has, what't it most "important". As far as I remember "Larry Page" was an "entrepreneur". So you don't need this property. Concentrate on the TON type.object.name.

How does one convert string to number in JDOQL?

I have a JDOQL/DataNucleus storage layer which stores values that can have multiple primitive types in a varchar field. Some of them are numeric, and I need to compare (</>/...) them with numeric constants. How does one achieve that? I was trying to use e.g. (java.lang.)Long.parse on the field or value (e.g. java.lang.Long.parseLong(field) > java.lang.Long.parseLong(string_param)), supplying a parameter of type long against string field, etc. but it doesn't work. In fact, I very rarely get any errors, for various combinations it would return all values or no values for no easily discernible reasons.
Is there documentation for this?
Clarification: the field is of string type (actually a string collection from which I do a get). For some subset of values they may store ints, e.g. "3" string, and I need to do e.g. value >= 2 filters.
I tried using casts, but not much, they do produce errors, let me investigate some more
JDO has a well documented set of methods that are valid for use with JDOQL, upon which DataNucleus JDO adds some additional ones and allows users to add on support for others as per
http://www.datanucleus.org/products/accessplatform_3_3/jdo/jdoql.html#methods
then you also can use JDOQL casts (on the same page as that link).

How to query individuals in DL Manchester OWL Syntax?

I know this sounds like a very stupid question, but I've been trying to figure this out and I can't find anything on this, though it seems obvious that this should be doable.
I'm developing something that queries an OWL file through its API using the Manchester OWL Syntax and a HermiT reasoner. I alternatively also run queries on the DL Query tab in Protege 4 to check my query results on that file. The file is basically the Friend Of A Friend (FOAF) ontology with added data instances.
The problem: I can't find a way to query an instance by its unique identifier.
It's supposed to be the URI so e.g. for a Person object with URI http://xmlns.com/foaf/0.1/Andrew_Kuchling, I tried to run the following queries:
Person and URI value "http://xmlns.com/foaf/0.1/Andrew_Kuchling"
Person value "http://xmlns.com/foaf/0.1/Andrew_Kuchling"
Person and URI value "Andrew_Kuchling"
Person that "Andrew_Kuchling"
none of these work. (The URI is constructed by prefixing http://xmlns.com/foaf/0.1/ to whatever string you enter and URI is not actually identified in the ontology as a property).
In FOAF, mbox_sha1sum is the sha1sum of a mailbox. Mailboxes are uniquely connected to individuals. So I tried the following query:
Person and mbox_sha1sum value "mbox_sha1sum-property-value-here"
However, it doesn't even execute this query because it feels the query is incorrect. The mbox_sha1sum value is the same that I've added for this Person. It exists in Individuals.
It does execute this query:
Person and firstName value "Andrew"
All data properties are not specialised data types. Treated as literals by default.
I really don't know what I'm doing wrong. Can someone please please help?
I know this question has been posted more than a year ago, but I recently asked me the same question and found the following solution:
Just put the name of the individual/member you want to query for in curly brackets:
{MyIndividualEntityName}
This way you can even query for more than one individual at a time:
{IndividualName1,IndividualName2}
Please note that these queries form class expressions of so called enumarated classes. This means, that the result of this query will not simply be a list of all super or sub classes of all the individuals you have named in your query. Instead it refers to an anonymous class that consists of exactly the individuals you have listed.
An anonymous class is a class that isn't available from outside of your ontology, because there is no referrable owl entity for this class (no IRI to refer to).
You can find more information on the OWL Manchester Syntax in the offcial W3C specification.

optional parameter addition to a colletion (asp.net C#)

Hello friends i am to add optional parameter to pass these in a method the parameter may vary every time.
And i need to pass these parameter to a method, so my question is how should i add these optional parameter to a collection and what kind of collection object should i use and how should i use that.
i elaborate here, i am having following fields.
1)course field(a drop down list) and on selected index change of course a check box list of corresponding branches are visible now i can select branches of choice by putting check mark on check boxes.(both course and branch are compulsory fields)
2)pass_out year which is a compulsory field.(a text field)
3)education gap which is optional so the text box may be empty as well and may having a digit as well.
4)required first year percent, second year, third year, final year, current degree, high school, senior secondary, gradation, post graduation, diploma percent, birth date which are all optional so these fields may also be empty or having a digit in the text box.
5) current backlog(a drop down list)having choices all, yes , no.
6)number of ATKT text box which may also be empty or can have a digit.
So i want to store all these variables value to some collection of object which will passed to a different method by passing all these variable from here,
But i am unable to figure out how should i store these optional variable to some object and how should i pass them to other method where all variable values will be taken out and an appropriate query will be written to interact with the data base to get the data table.
please elucidate me on this please. I am really not getting a feasible solution, i have thought of few options which i can let you know if you demand but those all seems to be tedious and difficult and redundant so i see help from you.
Don't bother with optional parameters or some collection of parameters, just decide how you will represent each value best, including how to represent empty values.
For a string value you can just use a null reference or an empty string. For a numeric value you can use a nullable int (int?). For a list of checkboxes where none is selected you can send an empty list.
When figuring out how to use this in a query to the database, it's easier if you have the values as parameters that always exist even if the values represent an empty value, rather than to have to parse out parameters from a collection where a parameter might be missing. Also, as you have different data types it's better if you can use an appropriate data type for each parameter, instead of casting everything into the same mold just to fit in a collection.

Resources