Closed eroux closed 4 years ago
TopQ_ValidateFacets
illustrates performing cases 2. and 3. using a ValidationEngine method for that purpose.
As committed it validates all and only the occurrences of PersonName for P707.
great thanks! Now we need a way to automate the test so that the property bdo:personName
is not hardcoded in the code. I think it having a property bds:followInGraph
would solve the problems, as we discussed. A caveat in the code is that it will be attached to inverse properties, such as adm:adminAbout
, but we can handle that in a second iteration
@xristy what do you think of adding the property? Worse case scenario we remove it later...
I've been working in this and the essential idea is:
bds:nodeShapeType : sh:NodeShape => bds:NodeShapeType
bds:NodeShapeType a owl:Class .
bds:FacetShape a bds:NodeShapeType .
bds:InternalShape a bds:NodeShapeType .
bds:IgnoredShape a bds:NodeShapeType .
these defns go in the root shapes ontology, http://purl.bdrc.io/shapes/core/CoreShapes/
.
Then:
Property prop = ResourceFactory.createProperty(BDS+"nodeShapeType");
Resource shapeType = ResourceFactory.createResource(BDS+"FacetShape");
ResIterator shapeItr = shapesModel.listResourcesWithProperty(prop, shapeType);
allows to iterate over the different shapes with an inner loop over the instances in the dataModel
.
well, I'm not entirely conviced it can work... for instance:
:InstanceA :instanceReproductionOf :InstanceB
in that case, :InstanceA
and :InstanceB
are in different graphs:InstanceA :hasPart :InstanceB
, here they're in the same graphso I think it's really about the property... or at least that's an argument for it. What use cases fit better with the class view?
Good example. We can perhaps just use bds:shapeType
on either property or node shapes, or maybe it would be simpler to have two separate properties to distinguish between node and property shapes
why not yes
Another obvious use case for having the property on propertyshapes and not nodeshapes:
:PersonA :teacherOf :PersonB
here we want to validate :PersonA
(because we're in the graph) but we don't want to validate :PersonB
, although it has the exact same shape. @xristy can you change that please? That would ease Marc's work
thanks! I'm not sure IgnoreShape
is a very good name though: it will be indeed ignored by the validator, but not by the editor. The property will instruct:
Yes, I realized in the middle of the night that I should add bds:ExternalType
. I'll change after I get going.
added bds:ExternalType
and changed most occurrences of bds:IgnoreType
excellent, thanks!
This is something that is specific to our architecture, as it has to do with the way we organize our graphs, files, etc. and not with the data itself. It would be important for the Java code to have a property on propertyshapes that indicates the way BUDA handles the presence or not of the object in the graph. I think we have four cases:
bdr:GenderMale
, or teachers and students of a person)bdo:hasPart
,bdo:partOf
,bdo:inRootInstance
andbdo:contentLocationInstance
, in other words, these are links we don't want to editor to follow in the same window@xristy do you think we could create properties for these? That would allow the
getFocusGraph()
to be implemented. I think we could rename it togetEditorGraph()
actually...