HTML5 & XHTML role attribute question - xhtml

Does the role attribute have defined values if so can you tell what they are?
Or can I create my own values for the role attribute if is so are they case-sensitive do they have to be letters can there be numbers or both?
Or can you have both defined values and user created values.

A quick google turned up this: Semantics in HTML 5.
According to that site, the values of the role attribute are a space separated list of words from the XHTML Vocabulary.

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.

How to determine if Mammo image is MLO or CC?

I'm confused as to which tags need to be examined to determined if a Mammo image is MLO or CC.
On sample sets I have I see the relevant information in View Position(0018,5101) i.e. a value of "MLO".
However looking at the standard it refers to Partial View Code Sequence (0028,1352) which is a sequence and there are more than just MLO/CC values.
The correct tag to check is the View Code Sequence, not the Partial View Code Sequence (that is only for partial views, as the name suggests, which seems not to be your case). In the sequence, you have to check the Code Value for the respective code. For example, MLO images get the code R-10226, as can be seen in the table.
Only if that sequence is not present or empty, you have to check for fallback tags like View Position. View Position is defined for CR and DX images, not for MG images (and actually does not have MLO or CC as defined terms), but as always, derivations from the DICOM standard by some modalities have to be taken into account, and you have to check if the images you process conform to the standard.

CSS/RegEx: Select elements where a certain attribute contains only numbers at certain locations

I am currently working on a web app and I need to query a data attribute that repeatedly shows up in a table.
In the table that I declare a data-test-id attribute that I can use later for testing. One example:
<td data-test-id="table-element-1-9:0-cell"> Hello world!<td>
I am querying the data attributes with a css selector for testing. The only thing that changes with each use of the data-test-id attribute are the three numbers which I will replace with X here:
/* css selector */
.select('[data-test-id="table-element-X-X:X-cell"]')
How do I create a regular expression to match all of the other characters is this attribute while ignoring the numbers denoted by X (as in the number denoted by X can be any number from 0-9)?
I tried using the following but it doesn't seem to work:
/\[data-test-id="table-element-[0-9]-[0-9]:[0-9]-cell"\]/g
Well AFAIK there is no regex-matching attribute selector in CSS. You could instead use a broader selector of
[data-test-id^="table-element-"][data-test-id$="-cell"]
This matches all elements with a data-test-id attribute that starts with table-element- and ends in -cell. Of course that might not be specific enough depending on the possible values of that attribute.
If that is the case, you could further filter the elements that are returned by above query using whatever language you call the select function from. For example using the regex you provided above.

How does one remove numeric id ending for restful URL in Google Analytics?

In Google Analytics, we track urls such as
/app/person/1
/app/person/78
or
/app/person/pet/456
/app/person/pet/65
And we'd like to remove the final Identifier so we can report on the page itself (i.e. /app/person and /app/person/pet)
Is there a way to do this? Thanks!
2 ways:
Search/Replace Filters: this will overwrite the original URLs with the non-numeric ones (if you ever want to know the exact original URL you're screwed).
Content Grouping: this will retain the original URLs, but will create a separate reporting option whereby you can switch from original URLs to your content group (see below example showing the page type, but you can really do whatever you want with content groups, including non-numeric IDs):
In both cases, you'll need a regular expression to handle the conversion: ([^0-9]+)/[0-9]+ should work (note that with GA's regular expression engine you do not need to escape /)
Accordingly the content grouping setup would look like:

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.

Resources