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.
|
// Must not be null on insert or update. Partial identifier on delete.
|
||||||
private String rangeURI = "";
|
private String rangeURI = "";
|
||||||
|
|
||||||
|
private String rootRangeURI;
|
||||||
// May be null. Partial identifier on delete.
|
// May be null. Partial identifier on delete.
|
||||||
private String domainURI;
|
private String domainURI;
|
||||||
|
|
||||||
|
@ -260,4 +262,12 @@ public class FauxProperty extends BaseResourceBean implements ResourceBean,
|
||||||
public String getRangeVClassURI() {
|
public String getRangeVClassURI() {
|
||||||
return getRangeURI();
|
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
|
String domainUri = domainUris.isEmpty() ? null : domainUris
|
||||||
.iterator().next();
|
.iterator().next();
|
||||||
|
|
||||||
|
Collection<String> rootRangeUris = getPropertyResourceURIValues(context, QUALIFIED_BY_ROOT);
|
||||||
|
|
||||||
FauxProperty fp = new FauxProperty(domainUri, baseUri, rangeUri);
|
FauxProperty fp = new FauxProperty(domainUri, baseUri, rangeUri);
|
||||||
|
if (!rootRangeUris.isEmpty()) {
|
||||||
|
fp.setRootRangeUri(rootRangeUris.iterator().next());
|
||||||
|
}
|
||||||
fp.setContextUri(contextUri);
|
fp.setContextUri(contextUri);
|
||||||
populateInstance(fp);
|
populateInstance(fp);
|
||||||
log.debug("Loaded FauxProperty: " + fp);
|
log.debug("Loaded FauxProperty: " + fp);
|
||||||
|
|
|
@ -226,6 +226,10 @@ public class FauxObjectPropertyWrapper extends ObjectProperty implements FauxPro
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getRangeEntityURI() {
|
public String getRangeEntityURI() {
|
||||||
|
String uri = faux.getRootRangeUri();
|
||||||
|
if (uri != null) {
|
||||||
|
return uri;
|
||||||
|
}
|
||||||
return innerOP.getRangeEntityURI();
|
return innerOP.getRangeEntityURI();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -176,9 +176,15 @@ public class GroupedPropertyList extends BaseTemplateModel {
|
||||||
List<FauxObjectPropertyWrapper> filteredAdditions = new ArrayList<FauxObjectPropertyWrapper>();
|
List<FauxObjectPropertyWrapper> filteredAdditions = new ArrayList<FauxObjectPropertyWrapper>();
|
||||||
for (FauxObjectPropertyWrapper prop : populatedFauxOPs) {
|
for (FauxObjectPropertyWrapper prop : populatedFauxOPs) {
|
||||||
List<String> allowedTypes = populatedObjTypes.get(prop.getURI());
|
List<String> allowedTypes = populatedObjTypes.get(prop.getURI());
|
||||||
if(allowedTypes != null && (allowedTypes.contains(prop.getRangeVClassURI())
|
if (allowedTypes == null) {
|
||||||
|| allowedTypes.contains(prop.getRangeEntityURI()) ) ) {
|
continue;
|
||||||
|
}
|
||||||
|
String rangeVClassURI = prop.getRangeVClassURI();
|
||||||
|
String rangeEntityURI = prop.getRangeEntityURI();
|
||||||
|
if(allowedTypes.contains(rangeVClassURI) ) {
|
||||||
filteredAdditions.add(prop);
|
filteredAdditions.add(prop);
|
||||||
|
} else if (allowedTypes.contains(rangeEntityURI)) {
|
||||||
|
filteredAdditions.add(prop);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return filteredAdditions;
|
return filteredAdditions;
|
||||||
|
|
Loading…
Add table
Reference in a new issue