FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

JCL-431: Improve containment validation by acoburn · Pull Request #653 · inrupt/solid-client-java · GitHub

Repository navigation

JCL-431: Improve containment validation - #653

Merged
acoburn merged 2 commits into
mainfrom
JCL-431-containment-validation
Aug 17, 2023
Merged

acoburn merged 2 commits into
mainfrom
JCL-431-containment-validation

Conversation

acoburn commented Aug 14, 2023

Copy link
Copy Markdown
Contributor

Resolves #634

This improves containment validation by considering more cases to be handled, specifically those containment triples that include fragment and query components.

The test cases have been expanded to include the additional cases.

The implementation makes more extensive use of normalized Java URI objects to achieve the improved validation.

acoburn requested a review from a team August 14, 2023 23:04
Comment on lines +86 to +87
if (getIdentifier().getPath().endsWith("/")) {
final String container = normalize(getIdentifier());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Newly, the condition is not normalized. This seems intentional.

But what happens with URIs of the form x/. and x/y/..?
Maybe we should normalize before checking whether it ends in a slash.

Example

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

getIdentifier from RDFSource via SolidRDFSource is a URI and getPath is not normalized.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

I've updated this to normalize the URI path

Comment on lines +105 to +110
if (!getIdentifier().getPath().endsWith("/")) {
messages.add("Container URI does not end in a slash");
}

// Get the normalized container URI
final String container = normalize(getIdentifier());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

As above.

Maybe worth extracting something like isContainer for readability and consistency.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

done in 2b4b916

if (!object.getIRIString().startsWith(container)) {
// Out-of-domain containment triple object

// 1 URI Structure Tests

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

What do these numbers refer to? I looked in several place I imagined would be relevant, but haven't found anything like this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

That was more for my own organization. I've backed that out

acoburn merged commit 286dfe4 into main Aug 17, 2023
acoburn deleted the JCL-431-containment-validation branch August 17, 2023 13:19
acoburn added a commit that referenced this pull request Aug 18, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

getResources can include non-child resources

3 participants


Back | FazBrowse Home | New Git URL