use qualified by root in faux property to provide into FauxObjectPropertyWrapper (#360)
Co-authored-by: Georgy Litvinov <georgy.litvinov@tib.eu>
This commit is contained in:
parent
2873bba81d
commit
8b2e150e32
4 changed files with 27 additions and 2 deletions
|
@ -23,6 +23,8 @@ public class FauxProperty extends BaseResourceBean implements ResourceBean,
|
|||
|
||||
// Must not be null on insert or update. Partial identifier on delete.
|
||||
private String rangeURI = "";
|
||||
|
||||
private String rootRangeURI;
|
||||
// May be null. Partial identifier on delete.
|
||||
private String domainURI;
|
||||
|
||||
|
@ -260,4 +262,12 @@ public class FauxProperty extends BaseResourceBean implements ResourceBean,
|
|||
public String getRangeVClassURI() {
|
||||
return getRangeURI();
|
||||
}
|
||||
|
||||
public void setRootRangeUri(String rootRangeUri) {
|
||||
this.rootRangeURI = rootRangeUri;
|
||||
}
|
||||
|
||||
public String getRootRangeUri() {
|
||||
return rootRangeURI;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -163,7 +163,12 @@ public class FauxPropertyDaoJena extends JenaBaseDao implements FauxPropertyDao
|
|||
String domainUri = domainUris.isEmpty() ? null : domainUris
|
||||
.iterator().next();
|
||||
|
||||
Collection<String> rootRangeUris = getPropertyResourceURIValues(context, QUALIFIED_BY_ROOT);
|
||||
|
||||
FauxProperty fp = new FauxProperty(domainUri, baseUri, rangeUri);
|
||||
if (!rootRangeUris.isEmpty()) {
|
||||
fp.setRootRangeUri(rootRangeUris.iterator().next());
|
||||
}
|
||||
fp.setContextUri(contextUri);
|
||||
populateInstance(fp);
|
||||
log.debug("Loaded FauxProperty: " + fp);
|
||||
|
|
|
@ -226,6 +226,10 @@ public class FauxObjectPropertyWrapper extends ObjectProperty implements FauxPro
|
|||
|
||||
@Override
|
||||
public String getRangeEntityURI() {
|
||||
String uri = faux.getRootRangeUri();
|
||||
if (uri != null) {
|
||||
return uri;
|
||||
}
|
||||
return innerOP.getRangeEntityURI();
|
||||
}
|
||||
|
||||
|
|
|
@ -176,8 +176,14 @@ public class GroupedPropertyList extends BaseTemplateModel {
|
|||
List<FauxObjectPropertyWrapper> filteredAdditions = new ArrayList<FauxObjectPropertyWrapper>();
|
||||
for (FauxObjectPropertyWrapper prop : populatedFauxOPs) {
|
||||
List<String> allowedTypes = populatedObjTypes.get(prop.getURI());
|
||||
if(allowedTypes != null && (allowedTypes.contains(prop.getRangeVClassURI())
|
||||
|| allowedTypes.contains(prop.getRangeEntityURI()) ) ) {
|
||||
if (allowedTypes == null) {
|
||||
continue;
|
||||
}
|
||||
String rangeVClassURI = prop.getRangeVClassURI();
|
||||
String rangeEntityURI = prop.getRangeEntityURI();
|
||||
if(allowedTypes.contains(rangeVClassURI) ) {
|
||||
filteredAdditions.add(prop);
|
||||
} else if (allowedTypes.contains(rangeEntityURI)) {
|
||||
filteredAdditions.add(prop);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue