Shacl rule to validate data file for mismatched type - shacl

I have a set of Shacl rules to validate the incoming data files. The issue is when the type of a record in the data file mismatches with the Shacl targetClass, no validation will be done and the Shacl validation engine just reports Success. I got a solution from this website, but it does not work for me. I have posted my Shacl rules and simple data here:
https://s.zazuko.com/b887FZ
The data type "DataInventoryRecord" (data row 20 from the right panel) is correct; when I change the target type, for example changing it to "dataInventoryRecord2", I expect an error, but no error is reported.
I got the idea of recordCountShape from the following post which was answered by Holger Knublauch:
How to check for a number of class instances with SHACL
Any help will be greatly appreciated!

The shape definitions look fine to me and also seem to work on the (old) SHACL Playground https://shacl.org/playground/

Related

Not able to use built-in models i.e. "user", error: no response from server

I have created many models in loopback for my project. And use these models with the help of "http://localhost:3000/explorer" in my browser.
These model API's are working fine. But, whenever I tried to use built-in models i.e "user" from the explorer. I got the below error:
and in the terminal. I got the below error. And terminal command automatically terminates.
I am new in the loopback. Why am I not able to use built-in models "user".
Please, help me.
Thanks in advance.
To anyone else that encounters this, I ran into this today and found this question unanswered, so I will do my best to give my explanation and findings here.
The error, roleModel.isInRole is not a function, means simply that the role model does not have a function called isInRole.
In my case, this was because another model was automatically generated from an existing database table called Role, which overrode the internal Role model of Loopback.
When the internal Role model is overridden, the isInRole function is not inherited automatically and will result in the above error.

Forge viewer Document.load throws exception on mobile devices

We are using Forge viewer version 3.2.x.
For Autodesk.Viewing.Document the function load(documentId,onSuccessCallback,onErrorCallback,accessControlProperties) the parameter accessControlProperties is listed as required (see Autodesk Forge Documentation). Not providing this parameter still works on Chrome / Firefox, but I discovered that missing the parameter causes problems on mobile devices. However, for this parameter there seems to be no example or specification available.
Maybe the problem is not the missing parameter itself but something else...? Getting the following exception in browser console:
Uncaught TypeError: Cannot read property 'id' of null
at PinchRecognizer.recognizeWith (viewer3D.js?v=3.2.*:2300)
at Array.forEach (<anonymous>)
at each (viewer3D.js?v=3.2.*:923)
at invokeArrayArg (viewer3D.js?v=3.2.*:903)
at PinchRecognizer.recognizeWith (viewer3D.js?v=3.2.*:2294)
at new Autodesk.Viewing.GestureHandler (viewer3D.js?v=3.2.*:16042)
at GuiViewer3D.Viewer3D.createControls (viewer3D.js?v=3.2.*:44685)
at GuiViewer3D.Viewer3D.initialize (viewer3D.js?v=3.2.*:44758)
at GuiViewer3D.initialize (viewer3D.js?v=3.2.*:50852)
at GuiViewer3D.Viewer3D.start (viewer3D.js?v=3.2.*:44555)
Using Viewer.loadDocument(documentId,onDocumentLoad,onLoadFailed,accessControlProperties) is not an option, because we must load multiple models into the viewer.
Apologies for the late response, we have a backlog in the queue due to the IFC issue this week.
According to my experience, the accessControlProperties is not a required parameter for using ViewingApplication.loadDocument(). Could you consider providing a reproducible case demonstrating this issue to forge.help#autodesk.com? I'm glad to help you check what happened.
A non-confidential reproducible case contains following items:
A short exact description of what you are trying to achieve.
The behavior you observe versus what you expect, and why this is a problem.
Some complete yet minimal sample models to run a test in. For example, Revit sample models here: https://knowledge.autodesk.com/support/revit-products/getting-started/caas/CloudHelp/cloudhelp/2016/ENU/Revit-GetStarted/files/GUID-61EF2F22-3A1F-4317-B925-1E85F138BE88-htm.html.
A complete yet minimal Forge viewer app that can run and debugged.
Detailed step-by-step instructions for reproducing the issue, e.g. which element to pick, what command to launch etc.
Thanks for your reply, Eason - isolating the issue from our whole application was quite difficult, but made me finally find the problem myself:
We had a conflict with another JavaScript library that is included in our minified js file. The GestureRecognizer classes are named similar as in the camunda library which we are using for modelling bpmn processes. Solved it by excluding that library from the global js and include it only where it is needed, same as how we are dealing with forge library.

Parsing twitter API Namespace georss:point Not bound

We are parsing the Twitter API in our application. This used to be working fine till yesterday, but now we get the following exception:
javax.xml.bind.DataBindingException: javax.xml.bind.UnmarshalException
- with linked exception:
[org.xml.sax.SAXParseException; lineNumber: 37; columnNumber: 577; The prefix "georss" for element "georss:point" is not bound.]
at javax.xml.bind.JAXB.unmarshal(JAXB.java:225)
Seems like there is a new XML tag present: georss:point The feed lacks the namespace declaration for the georss microformat and hence an error is thrown. Is someone also facing this issue? Does a work-round exist for this? Because it is bringing my app down currently.
Any help in this regard is highly appriciated. Thanks, Vaibhav.
The problem appears to be that the xmlns declaration for georss is missing from the feed since yesterday:
xmlns:georss="http://www.georss.org/georss"
There was a similar issue reported about a year ago (https://dev.twitter.com/discussions/625), seems to have resurfaced. Try adding that declaration.
Edit: the current issue has also been posted https://dev.twitter.com/discussions/10491
Yes wkoot removing the geo tag instead as i was not using it anyways then parsing the String now :( the only 2 legitimate solutions for now...

MOXy jaxb binding error for redefine element

Can any one help me ?
In my project, I need to pares some schema files, and need to generate xml files base on these schemas. Now ,I want to user MOXy to generate empty xml files base on these schemas dynamicly.But exception happened.
Internal Exception: com.sun.istack.SAXParseException2: "file:/F:/workspace/test/src/custom2.xsd" is not a part of this compilation. Is this a mistake for "file:/F:/workspace/test/src/custom.xsd"?
at org.eclipse.persistence.exceptions.JAXBException.errorCreatingDynamicJAXBContext(JAXBException.java:586)
at org.eclipse.persistence.jaxb.dynamic.metadata.SchemaMetadata$XJCErrorListener.error(SchemaMetadata.java:235)
at com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.error(SchemaCompilerImpl.java:316)
at com.sun.tools.xjc.reader.internalizer.Internalizer.reportError(Internalizer.java:628)
at com.sun.tools.xjc.reader.internalizer.Internalizer.reportError(Internalizer.java:619)
at com.sun.tools.xjc.reader.internalizer.Internalizer.buildTargetNodeMap(Internalizer.java:262)
at com.sun.tools.xjc.reader.internalizer.Internalizer.buildTargetNodeMap(Internalizer.java:391)
at com.sun.tools.xjc.reader.internalizer.Internalizer.transform(Internalizer.java:146)
at com.sun.tools.xjc.reader.internalizer.Internalizer.transform(Internalizer.java:108)
at com.sun.tools.xjc.reader.internalizer.DOMForest.transform(DOMForest.java:442)
at com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.java:230)
at com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.java:94)
at org.eclipse.persistence.jaxb.dynamic.metadata.SchemaMetadata.getJavaModelInput(SchemaMetadata.java:138)
at org.eclipse.persistence.jaxb.dynamic.DynamicJAXBContext.initializeFromMetadata(DynamicJAXBContext.java:209)
at org.eclipse.persistence.jaxb.dynamic.DynamicJAXBContextFactory.createContextFromXSD(DynamicJAXBContextFactory.java:345)
... 2 more
I think the reason is the redefine element, because when I use import or include,it's ok. Please help me. Can't upload attachement to stackoverflow?

JTreeTable model updating

I'm following the example of JTreeTable filesystem2 taken from the sun site http://java.sun.com/products/jfc/tsc/articles/treetable2/index.html#updating_the
My problem is that I can't update my model (and then my JTreeTable)...
In fact I create my model, I pass it to the JTreeTable and all work fine...but I need to modify the model...
I've yet answer a similar question, but now I've changed my code, without find a solution.
The problem is when and how I have to call the method fireTreeNodesChanged()...in the example above is used the method getPath() to retrieve information about the root node...but this is a method of File class..not my case...
Does anyone have a link to a simple code which shows how create a TreeTabelModel (with objects as nodes) and how update it?
FileBrowser is a good example of modeling a hierarchical file system as a tree. While its TreeModel is implemented using DefaultTreeModel, an alternative FileTreeModel is shown here. As mentioned in How to Use Trees: Creating a Data Model "the TreeModel interface accepts any kind of object as a tree node."