Hi Ilya,
there is no such thing out of the box at the moment, but I have recorded
this as a potential enhancement for 5.4 (we are very near the 5.3
release so I cannot simply add new features at this stage). I guess we
could add the default values automatically after file import operations
but in some cases users may need a feature to set the defaults for all
existing instances.
One current work-around is to issue a SPARQL UPDATE query against the
SPARQL end point. The query would be something similar to what we are
doing in swa:addDefaultValues. Assuming ?resource is the subject that
doesn't have default values yet:
INSERT {
?resource ?predicate ?value .
}
WHERE {
?resource swa:shapesForNodeFiltered ?shape .
?shape sh:property ?propertyShape .
?propertyShape sh:defaultValue ?value .
?propertyShape sh:path ?predicate .
FILTER isIRI(?predicate) .
}
If you need this often and want to expose it as a button, this operation
can be automated via a plugin into the teamwork user interface with SWP.
Holger
On 30/03/2017 0:50, Ilya Ushakov wrote:
HI Holger, That is what i need. It it nice, if it will fixed in
release version.
But I need to have the possibility for set default values for property
for existing instances of Concept as well.
Typical scenario:
1. Create new taxonomy.
2. Import triples with some properties to just created taxonomy.
3. It need to set default values for some properties for example
boolean types.
Is it possible out of the box?
On Tuesday, March 28, 2017 at 11:35:25 AM UTC+2, Holger Knublauch wrote:
Ok, that sounds like a new topic, so I have changed the subject
line :)
In order to set a default value for a property, and have this
default value used by EVN, you can use SHACL in TopBraid 5.3.
Create a property constraint such as in the following screenshot:
Any newly created instance of the class (here: Concept) will have
false as the default value for that property. Already existing
instances created before the constraint was defined remain unaffected.
Alas, I just noticed that this is not handled correctly in the
beta release of 5.3, in case you relied on that. It should work
there in the Ontology editor already.
Does this look similar to what you have tried?
HTH
Holger
On 28/03/2017 18:10, Ilya Ushakov wrote:
Additionally,
I would like to create new property of xsd:boolean type for
skos:Concept.
I need that the property has false value by default.
I created field with:
rdf:type: rdf:Property
rdfs:domain skos:Concept
rdfs:range xsd:boolean.
I added sh:defaultValue property and set it to false.
But in evn default value hasn;t been appeared.
So, Is it possible to add new property with default value?
On Tuesday, March 28, 2017 at 8:15:55 AM UTC+2, Ilya Ushakov wrote:
Hi Holger,
Yes. I did it. Everything works fine. Thank you for your advice
On Friday, March 24, 2017 at 2:51:36 PM UTC+1, Ilya Ushakov
wrote:
Hi everyone,
I need to have calculated field on skos:concept named
displayLabel.
The value of displayLabel should be concatenation of
"skos:prefLabel" and "comment" fields.
For this goal I made next:
1. Created comment and displayLabel properties
Both of them have:
rdf:type owl:DatatypeProperty.
rdfs:domain skos:Concept.
rdfs:range xsd:string
2. On skos:Concept I created spin:rule:
CONSTRUCT {
?this tr:displayLabel ?displayLabel .
}
WHERE {
BIND (trevn:displayLabelVal(?this) AS ?displayLabel) .
BIND (smf:trace("INFO: displayLabel {?1}",
?displayLabel) AS ?dummy) .
}
the code of magicProperty trevn:displayLabelVal:
SELECT ?displayLabel
WHERE {
?arg1 skos:prefLabel ?label .
OPTIONAL {
?arg1 trevn:comment ?comment .
} .
BIND (smf:if(bound(?comment),
smf:buildString("{?label} {?comment}"), ?label) AS
?displayLabel) .
}
3. I created test taxonomy and open it in TopBraid Composer.
When i run inside TopBraidComposer (Inference->Run
Inference) everything works fine.
4. When it runs inside EVN (after deploying), nothing is
happening.
I even see nothing in tomcat logs.
Apparently spin:rule was not being executed.
I added graph with my properties to "includes" on General
tab of taxonomy, but there were no any effects.
So, is it possible to run spin:rules on skos:Concept
instances? If, yes, what i did wrong?
--
You received this message because you are subscribed to the
Google Group "TopBraid Suite Users", the topics of which include
the TopBraid Suite family of products and its base technologies
such as SPARQLMotion, SPARQL Web Pages and SPIN.
To post to this group, send email to [email protected]
<javascript:>
---
You received this message because you are subscribed to the
Google Groups "TopBraid Suite Users" group.
To unsubscribe from this group and stop receiving emails from it,
send an email to [email protected] <javascript:>.
For more options, visit https://groups.google.com/d/optout
<https://groups.google.com/d/optout>.
--
You received this message because you are subscribed to the Google
Group "TopBraid Suite Users", the topics of which include the TopBraid
Suite family of products and its base technologies such as
SPARQLMotion, SPARQL Web Pages and SPIN.
To post to this group, send email to [email protected]
---
You received this message because you are subscribed to the Google
Groups "TopBraid Suite Users" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to [email protected]
<mailto:[email protected]>.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Group "TopBraid
Suite Users", the topics of which include the TopBraid Suite family of products and
its base technologies such as SPARQLMotion, SPARQL Web Pages and SPIN.
To post to this group, send email to [email protected]
---
You received this message because you are subscribed to the Google Groups "TopBraid Suite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.