SPARQL-query to select classes with multiple hasQuality - sparql

I have ontology opened in Protege. On the tab Entities -> Object Properties you can see that object BOX_1 has two hasQuality: RED and GREEN. What sparql-query can return BOX_1 as the object that has more than 1 hasQuality? here's the screenshot

Related

Is there a way to access the fields of a record, selected by a radio button widget in Google App Maker?

Summary
I am fairly new to AppMaker and this question centres on hierarchies. I have a Taxonomy table with a straight forward parent has children hierarchical relationship.
TaxonomyGroup -> has many Features -> has many Values
I've been working on a way to traverse this hierarchy using tile/grid widget.
When I reach the last node of the tree-structure I display this as a set of radio-buttons, representing the permitted options.
Example
Starting group is: Car
a Car has the following features:
-Colour
-Red
-Blue
-Silver
-Green
-Transmission
-Automatic
-Manual
-Fuel
-Petrol
-Hybrid
-Electric
If the parent group was Motorcycle, I would have a different set of features and options (permitted values).
A user selects the following for a Car:
+Colour
-Silver
+Trans
-Automatic
+Fuel
-Electric
Issue
While I can capture Silver, Automatic, Electric as the options selected, I cannot pick up the ID or any other fields of the record represented by the radio button selected.
Grid widget set-up
Taxonomy Grid Panel..... parent layer DS = Taxonomy (table) Id In [list]
Taxonomy Grid Child panel 'child' layer DS = TaxonomyChildren, ParentId = :parent
Radio button list DS = TaxonomyChildren: SubGroups (relation)
NB the radio button list sits within the Taxonomy Grid Child panel, so the list of options changes, based on the feature.
Radio button code onValueEdit event
// provides the row index of the selected Feature. e.g 'Transmission'
var rowIndex = widget.root.descendants.TaxonomyChildGridPanel.selectedIndex;
if (rowIndex === 0 ){
widget.root.descendants.Feature1.ID = widget.datasource.item.Id;
} else if rowIndex ===1 {
widget.root.descendants.Feature2.ID = widget.datasource.item.Id;
}
: //etc etc
}
Radio button widget issue
widget.datasource.item.Id
returns only the ID for the 1st item in the radio button list.
E.g. record ID 117 representing the option 'Petrol' not Electric as the radio button option selected.
I need to be able to capture the record behind the radio button selection, representing the node (called values) of the tree structure. In particular the ID of the record. Then store it against the creation of a new record, in this example a new Car record.
At present: onValueEdit event: the wrong record_ID is provided and it is always the 1st option in the radio-button list, irrespective of which option was chosen.
Screen shots
Grid panels for hierarchy levels 1 & 2, Radio buttons represent values
Hierarchy view with data
For this question resolution, see the answer given to the following question:
[How to obtain the record ID of the selected item in a dropdown list in google app-maker
Namely: onValueEdit event for the radio button selection the record id can be obtained using newValue. For Tick Boxes, it is newValues which builds an array of answers based on the items ticked.
if (!newValue) {
return;
} else {
answersDS.query.parameters.answerListIDs.push(newValue);
answersDS.load();
}

The method getKids() is undefined for the type PDField

https://issues.apache.org/jira/browse/PDFBOX-2148
When there are multiple copies with the same field name, the getFullyQualifiedName for each kid in the list of PDField objects returns the name of the parent, followed by .null. So if the parent field is called Button2 and it has 4 instances the result of printing out all the names will be:
Button2.null
Button2.null
Button2.null
Button2.null
According to the comments to the question, the OP refers to PDFBox 2.0.x versions, in particular 2.0.6.
getKids()
The method getKids() is undefined for the type PDField
In PDFBox 2.0.6 there are two immediate sub-classes of PDField. Different variants of the former (1.8.x) getKids() method are implemented in there:
PDNonTerminalField - the method retrieving the kids in this class is getChildren() and returns a List<PDField>, a list of form fields.
PDTerminalField - the method retrieving the kids in this class is getWidgets and returns a List<PDAnnotationWidget>, a list of widget annotations.
name of the parent, followed by .null
When there are multiple copies with the same field name, the getFullyQualifiedName for each kid in the list of PDField objects returns the name of the parent, followed by .null
This is not the case in PDFBox 2.0.x.
In the sample document attached to the PDFBox issue PDFBOX-2148 PDFBox now correctly finds only a single field which appropriately is named "Button2". This field is a PDTerminalField and has 4 widget annotations. The class of the latter, PDAnnotationWidget, has no getFullyQualifiedName method, so there are no ".null" names.
Thus, this problem is gone.
FQN of duplicate fields
(from the OP's comment responding to "What exactly is your question?")
how to get Fully Qualified Name of duplicate fields in pdfbox
There are no duplicate fields in (valid) PDFs, for a given name there is at most a single field which may have multiple widgets. Widgets do not have individual FQNs.
Thus, what you call "duplicate fields" in your example document actually is a single field with multiple widgets; the name of that field is "Button2" and can be retrieved using getFullyQualifiedName().
which page which form field
(from the OP's comments to this answer)
but how to get current page no in pdfbox.. for example there are 3 page and in page 2 there is a form field so how can i get which page which form field ?
All PDAnnotation classes, among them PDAnnotationWidget, have a getPage() method returning a PDPage instance.
BUT: As specified in ISO 32000-1, annotations (in particular form field widgets) are not required to have a link to the page on which they are drawn (except for screen annotations associated with rendition actions).
Thus, the above mentioned method getPage() may return null (probably more often than not).
So to determine the respective pages of your widgets, you have to approach the problem the other way around: Iterate over all pages and look for the annotation widgets in the respective annotation array.
For PDFBox 1.8.x you can find example code in this stackoverflow answer. With the information given in the previous parts of this answer it should be easy to port the code to PDFBox 2.0.x.
checkbox and radio button
(also from the OP's comments to this answer)
one more issue if i am using checkbox and radio button both then field.getFieldType() output is Btn for both. how to identify it?
You can identify them by inspecting the field flags which you retrieve via fields.getFieldFlags():
If the Pushbutton flag is set (PDButton.FLAG_PUSHBUTTON), the field is a regular push button.
Otherwise, if the Radio flag is set (FLAG_RADIO), the field is a radio button.
Otherwise, the field is a check box.
Alternatively you can check the class of the field object which for Btn may be PDPushButton, PDRadioButton, or PDCheckBox.
Beware: If a check box field has multiple widgets with differently named on states, this check box field and its widgets act like a radio button group! And not only in theory, I've seen PDFs with such check box fields in the wild.
To really be sure concerning the behavior of the fields, you therefore also should compare the names of the on states of all the widgets of a given check box.

RowFilter on JFace TreeViewer

I have a TreeViewer as shown here:
.
I have a text field to enter the percentage values. Suppose the percentage entered is 30 %, I should hide all the rows that are below 30% and display only the rows above 30%. Is there any row filter that I can use for my TreeViewer? It would be great if some examples are provided.
I am using e4 RCP. I want to do View based filtering and prefer not to change the Model.
You use a class which extends ViewFilter to filter the rows in a tree viewer.
The main method to override in the ViewFilter is the select method:
#Override
public boolean select(Viewer viewer, Object parentElement, Object element)
here you are given the object being considered (element) along with its parent and the viewer. You return true to keep displaying the element and false to hide it.
You can have several filters active if required, set them in the tree viewer using:
treeViewer.setFilters(array of view filters);
You may need to call
treeViewer.filter();
when something changes in the tree which requires the filters to be re-run.

how to get child properties of the div object for rational functinal tester

in my application i have a dropdown which is div object.the dropdown contain names and checkboxes.i need select the checkbox based on name. checkbox dont have any name.just index.can any one suggest how to get chaild items or properties of the objects for div object.
and the second question is i have tree view .which is teleric object.RFT is unable to find the object.it identifying as one all tree view is one object.its not identifying the childs,sub tree items....
so please help me on this two issues.
Hi you can get the checkboxes as follows:
void getCheckBoxes(TestObject parentDiv)
{
TestObject[] checkboxes = parentDiv.find(atDescendant(".class","Html.INPUT.checkbox"));
System.out.println("Found " + checkboxes.length);
//Go through them , and decide which one to select.
for(TestObject checkbox: checkboxes)
{
System.out.println("Checkbox Value: "+ checkbox.getProperty(".value"));
}
}
you can call the above method and pass it the parent DIV object.
About the second question:
You have not mentioed how does RFT recognize the one object for the tree ( means which proxy does it use as per the object map's adminitrative properties for that object).
Usually controls like tree /grid etc are recognized as one control and the items of these controls as "Subitem" which are found by specifying subitem as atPath("xyz->abc") etc.

MVC Complex ViewModel

I need to build a sample MVC UI app using Kendo UI.
I have 2 multiselect widgets for airline names and airport names respectively and below I have a grid with airline airport data.
Now when I select airlines or airports in the multiselect, upon clicking a Fetch button, the grid should refresh.
I created a ViewModel named AirlineAirportViewModel for containing List<Airlines>, List<Airports> and List<AirlineAirports>.
I instantiate the List<AirlineAirports> in the Get action method of the controller and fill the other two lists getting distinct airline and airport values from the List<AirlineAirports>.
While posting on filter button click, I am able to get action parameters as 2 List<string> types which contain only the selected multiselect items
Instead of that, I want this action parameter of type AirlineAirportViewModel so that in future, I will be able to add more filter widgets and the number of parameters stay one only.
Now, am I approaching this in the right way ? If I need the ViewModel as action parameter, where should I store the selected items from the multiselects ?