jdbcDatatable id possible values - iccube

In the schema.icc-schema schema definition xml file, in the jdbcDatatable tag there is an id attribute which looks like a serial number (3362e2cc-a588-492a-af9a-ea3b0e788ec4 in my case).
This id is used later in a multiLevelDimension tag to identify the table source via the dataTableId tag.
Is the id any arbitary string, or has it to conform to a special format? In other worlds, may I use an id like "foodmart-store" or "foodmart.store", to ease the migration of a Mondrian scheme into a icCube schema?

You can use any format as long as it is unique (better within the schema).

Related

Riak: searchable list of maps (with CRDTs)

I have a use-case which consist in storing several maps under an attribute. It's the equivalent JSON list:
[
{"tel": "+33123456789", "type": "work"},
{"tel": "+33600000000", "type": "mobile"},
{"tel": "+79001234567", "type": "mobile"}
]
Also, I'd like to have it searchable at the object level. For instance:
- search entries that have a mobile number
- search entries that have a mobile number and whose number starts with the string "+7"
Since Riak doesn't support sets of maps (but only sets of registers), I was wondering if there is a trick to achieve it. So far I've had 2 ideas
Map of maps
The idea is to generate (randomly?) keys for the objects, and store each object of the list in a parent map whose keys are the ones generated for this only purpose to have a key.
It seems to me that it doesn't allow to search the object (maps inside the parent map) because Riak Solr search requires the full path to the attribute. One cannot simply write the following Solr query: phone_numbers.*.tel:+7*. Also composed search (eg. search entries that have a mobile number and whose number starts with the string "+7") seem hard to achieve.
Sets with simulated multi-valued attributes
This solution consists in using a set and insert all the values of the object as a single string, with separators between them. Yes, it's a hack. An attribute value would look like: $tel:+79001234567$type:mobile$ with : as the attribute name-value separator and $ as the attribute separator.
Search could be feasible using the * wildcard (ugly, but still), except the problem with escaping the separators: what if the type attribute includes a :? Are they some separators that are accepted by Riak and would not be acceptable in a string (I'm thinking of control characters)?
In a nutshell
I'm looking for a solution whatever the hackiness of it, as long as it works. Any idea is welcome.

Define custom property of type date and use it in query

The professional version of Artifactory allows to define custom properties for artifacts. Usually, these are key/value pairs where the value is a String.
Is it also possible to use dates (or numbers) as value?
I would like to define a property like "doNotUseAfter" with a date. Then I would like to use the Artifactory query language to find out which artifacts have a doNotUseAfter date that is already in the past.
All property values are strings, or collections of strings. There is no type information built-in to properties. However, if you format your dates as strings using a sortable encoding (such as ISO 8601), you can use an AQL query to string-compare to the current date in the same format.
For example, if your artifact has a property doNotUseAfter: 2018-10-22, you can use the following AQL query to find it:
items.find({"#doNotUseAfter": {"$lt": "2019-02-01"}})
Note that AQL does have specific support for date and numeric data, but as far as I can tell, that only applies to fields like modified or size that always have those types; I'm fairly certain it doesn't parse arbitrary properties as one type or another based on formatting. This could cause problems when sorting or comparing numeric properties, since the string "5" is considered larger than "43" for example, but for dates and timestamps in a sortable format, there is no such issue.

How to use Update and Insert Value XQuery in PHP

I am using XML based database to save the records of large scale data in my web application. I know how to fetch all the data or specific data through XML tags in PHP. But I have no idea how I can update the data stored in XML tags using PHP. For instance I want to update the following XML tag by using XQuery from PHP.
<program id="p00547jm">
<time>
<startTime>1003394820</startTime>
<endTime>1003394826</endTime>
<epochStart>2001-10-18T08:47:00</epochStart>
<epochEnd>2001-10-25T08:47:00</epochEnd>
</time>
<completeTitle>in_our_time:_democracy</completeTitle>
<mediaType>audio</mediaType>
I am using following XQuery to update the value of 1 particular XML tag:
$query='for $x in doc("coursework")/bbcPrograms/program
where $x/completeTitle="'.$single_edit_program_title_hidden.'"
and $x/mediaType="'.$single_edit_program_type_hidden.'" and
$x/masterBrand="'.$single_edit_masterbrand_hidden.'" and
$x/service="'.$single_edit_service_hidden.'"
return update value $x/completeTitle[.="'.$single_edit_program_title_hidden.'"] with "'.$single_edit_program_title.'"';
It works correctly when we want to update 1 particular XML tag value. Now I want to make this XQuery work for updating tags values of multiple XML tags. Just as we do normally in SQL. SET id='abc' AND name = 'xyz'...
Please help me how this Xquery can work for multiple tags values update.

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

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.

Using / in query strings

I am trying to use query strings in ASP.NET. I have a requirement of the following format
http://localhost/website/1/?callback=?
Here 1 denotes the ID of the profile. This means some info from id=1 will be fetched through the string
If this would have been website/2/?callback=? , then the id would be 2. My questions is to how do I use this /id/ as a query string so it can be used to fetch the profile ID. This was my first preference to use /id/ format otherwise I could look into fetching using two ?'s
If the id =1, I want to fetch ID=1 particulars from DB on this page. http://localhost/website/1/?callback=?
In your case the ID is in the PATH, not the query string. You can access the path via Request.Path in an ASPX page. From there you would need to do some string parsing to get at the portion of the path where you expect the ID to be.
In your case I would probably use something like int.Parse(Request.Path.Split(new char[] {'/'}, StringSplitOptions.RemoveEmptyEntries)[1]), but please note that I've made that line pretty dense for brevity's sake. For starters, you should use int.TryParse() instead of int.Parse(). This code assumes that the ID will always be in the same place in the url. For example, it will work for "/website/2/" and "/user/2/", but not for "/website/somethingelse/2/".
UriTemplate might be a good choice for that sort of parsing. Not to mention, probably a bit more clear and explicit about what's happening.
Check out: http://msdn.microsoft.com/en-us/library/system.uritemplate(v=VS.90).aspx

Resources