Re: [topbraid-users] Message returned by spin:constraint?
On 8/1/2014 2:00, ja...@howison.name wrote: I'm working with spin constraints (spin 1.4.0 via Maven). I have them firing but I'm confused about how to label them so I can see which constraint has failed. The full code (and data) is at https://github.com/jameshowison/softcite ( This is very cool. I am glad to see more projects using SPIN, some of them with Turtle files edited by hand. If you do edit these files by hand, I would still recommend to make them easier to open with TopBraid (Free Edition) and similar RDF tools. All you would need to do is add some owl:Ontology into every file and define explicit owl:imports so that when you load the example file, it will pull all other necessary files into TopBraid. This may help you get more feedback because more people could understand what's going on (without stepping through Java code). Just an idea. may be some local paths in there, sorry!) and I run the constraints via mvn -Dtest=AppTest#testSPINConstraints test I'm using the output code from the Kennedy's example, edited to use getCustomizedLabel rather than getLabel (although using just getLabel doesn't work as I'd expect either): for(ConstraintViolation cv : cvs) { System.out.println( - at + SPINLabels.get().getCustomizedLabel(cv.getRoot()) + : + cv.getMessage()); I've tried to follow the code through cv.getMessage() but I got lost in abstract interfaces somewhere :) This is the constraint: bioj:SoftwareMention a rdfs:Class ; spin:constraint [ a spl:Attribute ; rdfs:comment Must have one and exactly one classification ^^xsd:string ; spl:predicate citec:mention_category ; spl:minCount 1 ; spl:maxCount 1 ; # spl:valueType citec:MentionClassification ; # spl:defaultValue ex:Red ] ; . Originally I was working with 1.3.1 and I was getting the Resource ID but no message: - at citec:a2007-36-BMC_PLANT_BIOL-B03-mention: Now I've upgraded to 1.4.0 and I'm getting a generic message (progress!): - at citec:a2007-36-BMC_PLANT_BIOL-B03-mention: Attribute citec:mention_category : [1,1] Yes I had fixed this bug in 1.3.3 because several users complained that the message was empty. It now behaves more consistently with TopBraid. If the template has a spin:labelTemplate then it will use that. But how would I output the rdfs:comment from the constraint? As a secondary, but likely related question, I have this constraint: bioj:ArticleSoftwareLink a rdfs:Class ; spin:constraint [ a sp:Ask ; sp:text # Can only find versions if they exist ASK WHERE { ?this a bioj:ArticleSoftwareLink ; citec:has_version_indicator false ; citec:version_is_findable true . } ] ; . That outputs the generic: - at bioj:a2003-44-BBA-GEN_SUBJECTS-SWISS-MODEL: SPIN constraint at bioj:ArticleSoftwareLink But I'd like it to output the comment in the query ( # Can only find versions if they exist ), I understand that the sp:text gets parsed and that should end up as an rdfs:comment property on the constraint, not sure if that's actually right. In the SPIN RDF syntax (without sp:text), the RDF syntax tree would have an rdfs:comment triple at the sp:Ask. So you could try to move the # into an rdfs:comment triple and see if it works better. It is difficult to rely on the # comment in the sp:text syntax because this information is thrown away by the SPARQL parser. The sp:Ask object is there to allow to attach exactly that kind of explicit metadata. I would also suggest you switch to CONSTRUCT, which gives you more options, especially to also specify a spin:violationPath. When you CONSTRUCT the spin:ConstraintViolation, you can freely chose an rdfs:label, and that label could be the result of your own CONCAT string operations in the WHERE clause. In any case (and perhaps more confusingly) I'd tried having the comment as rdfs:comment or rdfs:label for the constraint, but having either of those there produces a NullPointerException: java.lang.NullPointerException at org.topbraid.spin.util.JenaUtil.getStringProperty(JenaUtil.java:617) at org.topbraid.spin.system.SPINLabels.getCustomizedLabel(SPINLabels.java:57) at edu.utexas.ischool.jhowison.TTLRepository.runSPINconstraints(TTLRepository.java:523) The NullPointer is because the ConstraintViolation has no root resource, so this problem is IMHO unrelated to the constraint violation's message. I will try look into your example more next week, as it is quite possible that you are pointing at things to improve. Meanwhile: would it be possible for you to make the files a bit more TopBraid-friendly so that they are easier to open and study? Thanks, Holger -- -- You received this message because you are subscribed to the Google Group TopBraid Suite Users, the topics of which include Enterprise
Re: [topbraid-users] Re: Viewing a Resource as an SWP hangs TBC 4.3.1
To close the loop on this... I tried the same tests using a fresh install of TBC 4.5.0. I experienced none of the problems of 4.3.1. I did import all the projects from the 4.3.1 workspace so on one hand, that should have duplicated the problem if it still exists. On the other hand, if letting TBC look through the triple store checked a box so to speak and that result was stored in the workspace then that's a different outcome. For now I'm just going to work in 4.5 and hope the problem doesn't come back. I don't relish the idea of trying to track down all the .ui. files and check for references to the Oracle connectors (although there shouldn't be any - only references in SM scripts serving as web services). :) Thanks for all of the responses, Tim On Thu, Jul 31, 2014 at 6:56 PM, Holger Knublauch hol...@topquadrant.com wrote: Hi Tim, I cannot see why it would even access the Oracle database if it has nothing to do with the rest of your graphs. Maybe some .ui. file has a reference to it? In any case, please make sure that Cache all is deactivated in the TBL Administration settings. HTH Holger On 8/1/14, 6:36 AM, Tim Smith wrote: Hi Mark, I thought of that so I had re-started TBC just prior to those tests. It should have had full connectivity, if it didn't, it might have hung but I doubt the memory footprint would have grown much. I will download 4.5 and try the same thing in the next day or so. Thanks, Tim On Thu, Jul 31, 2014 at 4:29 PM, Mark Graham m...@topquadrant.com wrote: Hi Tim, One possible impact is the disconnect from the DB connection. If this occurs then restart of TBC needed. This is resolved in 4.5 Thanks, Mark Mark Graham TopQuadrant Support On Thu, Jul 31, 2014 at 4:21 PM, Tim Smith smith.ts...@gmail.com wrote: Third Update: Memory footprint of TBC is at 17,737,624KB. Apparently I waited long enough as the localhost SWP call has completed. Now if use Resource -Show as SWP Page it works promptly. My guess is that TBC felt the need to download all the triples (nearly 70 million of them). How do I keep this from happening? I understand that it might be looking for relevant SWP views but I think it should only search in graphs that are directly related to the open file or its imports. Thanks for your input! On Thu, Jul 31, 2014 at 4:16 PM, Tim Smith smith.ts...@gmail.com wrote: Second Update: TBC memory footprint is over 17GB... it will max at 28GB so I'm going to kill it. Additional test: I deployed the same project to a TBL server that does not have the Oracle connector files and it returns the SWP in a second or so. On Thu, Jul 31, 2014 at 3:57 PM, Tim Smith smith.ts...@gmail.com wrote: Update: I've tried to access the same resource using a browser via: localhost:8083/tbl/swp?_resource=resource URI My PC is chewing up a small amount of CPU and the memory footprint of TBC has grown from 1-2GB to over 10GB. My guess is that it is downloading all the triples from the Oracle triple store. Any way to tell what is happening? On Thu, Jul 31, 2014 at 3:04 PM, Tim Smith smith.ts...@gmail.com wrote: I am having difficulty viewing a resource as an SWP page in TBC. My ontology file has no imports and no SWP definitions other than the default capabilities of TBC. I select Resource - Open in SWP Browser. Once I do that, TBC sits and churns. I've never let it run past 5 minutes so maybe it would come back but 5 minutes to display a generic SWP page should be more than enough. I think this has to do with the fact that I have oracle connector files to the Oracle RDF store in my workspace. My guess is that it is scanning the 70 million triples for something. Why? Well, if I put my PC to sleep with TBC running, TBC will throw an error with it wakes up indicating that it has lost the connection to Oracle - this happens even though I have nothing open in the workspace that uses the connector files. If I have the same ontology open and select Resource - Open in SWP Browser while TBC is in this state, I get a number of Java errors related to a failed Oracle connection (I can recreate and share the error if necessary). Any thoughts on why Open in SWP Browser would have anything to do with an Oracle back-end that is not referenced in any way in the open graph? Thanks for your input, Tim -- -- You received this message because you are subscribed to the Google Group TopBraid Suite Users, the topics of which include Enterprise Vocabulary Network (EVN), TopBraid Composer, TopBraid Live, TopBraid Insight, SPARQLMotion, SPARQL Web Pages and SPIN. To post to this group, send email to topbraid-users@googlegroups.com To unsubscribe from this group, send email to topbraid-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/topbraid-users?hl=en --- You received this
Re: [topbraid-users] faceted search on classes rather than instances?
By 'instance-tizing' my classes (make them rdf:type my superclass), I can get facets. I am glad that I have made some progress, but that seems like the wrong approach since they are really classes. Even when I do this, in 4.4 I get no search results. I migrated this 'instancetization' back to 4.2 and I get facets and search results. So I must not have swa:FacetedSearchGadget and swa:SummarySearchResultsGadget wired up properly. Are they supposed to be related by arg:id or some such? In the demo, where swa:Window is used, they have arg:id values, but my div approach does not. Any comments would be welcome. Examples of the two approaches are provided below (the rest of the content is basically identical between 4.2 and 4.4). 4.2 version: div class=ui-layout-center width=600px swa:Header arg:label={= spl:object(?viewTemplate, ssfhtml:centerHeader) }/ table tr td id=facetsCell valign=top width=450px div id=facetsProgressIndicatorLoading {= ui:label(?treeRoot) }.../div scriptstartFacets('http://siemens.com/1.0/vocab/biomed-symp#Symptom','','ssf-instance-page');/script /td td id=resultsCell style=padding-left: 12px valign=top width=450px/ /tr /table /div 4.4 version: div class=ui-layout-center width=600px swa:Header arg:label={= spl:object(?viewTemplate, ssfhtml:centerHeader) }/ table tr td id=facetsCell valign=top width=450px swa:FacetedSearchGadget arg:resourceType=biomed-symp:Symptom ui:args=*/ /td td id=resultsCell style=padding-left: 12px valign=top width=450px swa:SummarySearchResultsGadget ui:args=*/ /td /tr /table /div Jack On Friday, July 25, 2014 8:32:29 AM UTC-7, Jack Hodges wrote: Do you have a project upload mechanism that I can use. The workspace, compressed, is 223 MB. I have sent a project description to your email address. Jack On Thursday, July 24, 2014 7:47:52 PM UTC-7, Holger Knublauch wrote: Hi Jack, sorry but I believe we will need to get hands on your example file to help you further. Off-list is fine. Holger On 7/25/2014 5:20, Jack Hodges wrote: Hello Irene, I checked all of the classes and they are all rdf:type owl:Class (they subclass owl:Thing). I checked all of the properties I am using as facets and the items in all of their domains and ranges are rdf:type owl:Class. But no faceted search (I closed and opened the model and refreshed the caches and the swp graphs). Jack On Thursday, July 24, 2014 11:26:37 AM UTC-7, Jack Hodges wrote: Thanks! On Thursday, July 24, 2014 8:28:41 AM UTC-7, Irene Polikoff wrote: Jack, I don’t believe sub-classing is either an issue or a requirement here. Faceted search works over instances of a class. Classes are instances of either rdfs:Class or owl:Class. So, you need to be faceting over either rdfs:Class or owl:Class. And properties to select from as facets would need to be associated with these e.g., have owl:Class in their domain. Irene *From:* topbrai...@googlegroups.com [mailto:topbrai...@googlegroups.com] *On Behalf Of *Jack Hodges *Sent:* Thursday, July 24, 2014 11:17 AM *To:* topbrai...@googlegroups.com *Subject:* Re: [topbraid-users] faceted search on classes rather than instances? I am trying to build faceted search across standard models/repositories. In this case the classes are terminals for the repository and contain all the information an instance would carry. For example, in the obolibrary DOID, disease obo:DOID_9352 is fully populated with content, and the disease is unlikely to be subclassed or instantiated. My understanding is that these classes can participate in faceted search under certain circumstances. First, they have to subclassed under one of my classes. Also, for classes to be facetable they need to carry properties and look like resources. I created namespaces such as the following for Symptoms: http://siemens.com/1.0/vocab/biomed-symp and a prefix for it: biomed-symp. I created a class called Symptom and then subclassed several (for the purposes of a demo) of the classes in the obolibrary (e.g., obo:SYMP_455) to biomed-symp:Symptom. I did the same for diseases (etc.). I created facets to bridge the repositories, such as biomed-symp:involvesDisease, that I hung off biomed-symp:Symptom in the defaultFacets property. In the vocabulary, I added these properties (e.g,.
Re: [topbraid-users] faceted search on classes rather than instances?
Would it work if you just start with the facetsapp (and its swa:Windows) and then add your tree component or whatever else you need into it? Yes, swa:Windows are needed to trigger the reload correctly, i.e. when you change the facets, the right hand side needs to reload. Holger On 8/2/14, 9:28 AM, Jack Hodges wrote: By 'instance-tizing' my classes (make them rdf:type my superclass), I can get facets. I am glad that I have made some progress, but that seems like the wrong approach since they are really classes. Even when I do this, in 4.4 I get no search results. I migrated this 'instancetization' back to 4.2 and I get facets and search results. So I must not have swa:FacetedSearchGadget and swa:SummarySearchResultsGadget wired up properly. Are they supposed to be related by arg:id or some such? In the demo, where swa:Window is used, they have arg:id values, but my div approach does not. Any comments would be welcome. Examples of the two approaches are provided below (the rest of the content is basically identical between 4.2 and 4.4). 4.2 version: div class=ui-layout-center width=600px swa:Header arg:label={= spl:object(?viewTemplate, ssfhtml:centerHeader) }/ table tr td id=facetsCell valign=top width=450px div id=facetsProgressIndicatorLoading {= ui:label(?treeRoot) }.../div scriptstartFacets('http://siemens.com/1.0/vocab/biomed-symp#Symptom','','ssf-instance-page');/script /td td id=resultsCell style=padding-left: 12px valign=top width=450px/ /tr /table /div 4.4 version: div class=ui-layout-center width=600px swa:Header arg:label={= spl:object(?viewTemplate, ssfhtml:centerHeader) }/ table tr td id=facetsCell valign=top width=450px swa:FacetedSearchGadget arg:resourceType=biomed-symp:Symptom ui:args=*/ /td td id=resultsCell style=padding-left: 12px valign=top width=450px swa:SummarySearchResultsGadget ui:args=*/ /td /tr /table /div Jack On Friday, July 25, 2014 8:32:29 AM UTC-7, Jack Hodges wrote: Do you have a project upload mechanism that I can use. The workspace, compressed, is 223 MB. I have sent a project description to your email address. Jack On Thursday, July 24, 2014 7:47:52 PM UTC-7, Holger Knublauch wrote: Hi Jack, sorry but I believe we will need to get hands on your example file to help you further. Off-list is fine. Holger On 7/25/2014 5:20, Jack Hodges wrote: Hello Irene, I checked all of the classes and they are all rdf:type owl:Class (they subclass owl:Thing). I checked all of the properties I am using as facets and the items in all of their domains and ranges are rdf:type owl:Class. But no faceted search (I closed and opened the model and refreshed the caches and the swp graphs). Jack On Thursday, July 24, 2014 11:26:37 AM UTC-7, Jack Hodges wrote: Thanks! On Thursday, July 24, 2014 8:28:41 AM UTC-7, Irene Polikoff wrote: Jack, I don’t believe sub-classing is either an issue or a requirement here. Faceted search works over instances of a class. Classes are instances of either rdfs:Class or owl:Class. So, you need to be faceting over either rdfs:Class or owl:Class. And properties to select from as facets would need to be associated with these e.g., have owl:Class in their domain. Irene *From:*topbrai...@googlegroups.com [mailto:topbrai...@googlegroups.com] *On Behalf Of *Jack Hodges *Sent:* Thursday, July 24, 2014 11:17 AM *To:* topbrai...@googlegroups.com *Subject:* Re: [topbraid-users] faceted search on classes rather than instances? I am trying to build faceted search across standard models/repositories. In this case the classes are terminals for the repository and contain all the information an instance would carry. For example, in the obolibrary DOID, disease obo:DOID_9352 is fully populated with content, and the disease is unlikely to be subclassed or instantiated. My understanding is that these classes can