buda-base / lds-pdi

http://purl.bdrc.io BDRC Linked Data Server
Apache License 2.0
2 stars 0 forks source link

making sure that Github is not accessed #188

Closed eroux closed 4 years ago

eroux commented 4 years ago

Looking at some logs, it seems that when we load the local ont-policy.rdf, it still reads the rest of the files on github instead of the local version, we need to check that and fix if necessary

MarcAgate commented 4 years ago

@xristy In the ontology specs of all ontPolicy.rdf files, could you remove all the allUrl tags that point to a github raw file url? This way we make sure that the ontDocumentManager is really picking up the local repo files. I can do it if you are too busy.

eroux commented 4 years ago

I don't think it's a good solution, it's still quite interesting to allow softwares like TopQuandrant to get the whole ontology using just one URI... Perhaps there might be a way to ask the ontmanager to prefer local files to distant ones? @xristy if no such thing exists, perhaps it would be worth reporting an issue?

MarcAgate commented 4 years ago

ok, I'll look at it, meanwhile, I am going to create another ontPolicy.rdf for testing. I still have to validate that files are still downloaded from github.

eroux commented 4 years ago

Ok thanks! I think it's apparent in the DEBUG logs

eroux commented 4 years ago

or maybe an alternative would be to have a ont-policy-local.rdf on github with only references to local files?

MarcAgate commented 4 years ago

Ok, I am going to do this: ont-policy-local.rdf without "raw" urls, at least for testing, something that we will remove later on.

xristy commented 4 years ago

One possibility might be to make use of path in the OntDocumentManager constructor.

The path could be like:

"/path/to/local/ont-policy.rdf;https://raw.githubusercontent.com/buda-base/editor-templates/master/ont-policy.rdf"

and omit the local policy file for production outside of China.

The path is not limited to just 2 elements.

xristy commented 4 years ago

Looking further, only a single altURL per OntologySpec is used so the current ont-policy.rdf in owl-schema and editor-templates should be actually two different files as has been mentioned above one would be ont-policy-local.rdf and the other would be ont-policy.rdf.

Then on the China server or a development server there would be a configuration item indicating a URI for the appropriate policy file. Master copies of the two files will be in github for both owl-schema and editor-templates.

The ont-policy.rdf defines an xml entity

<!ENTITY git     'https://raw.githubusercontent.com/buda-base/'>

The ont-policy-local.rdf defines an xml entity

<!ENTITY local   'file:///Users/chris/git/'>

So the above definition needs to be changed depending on where directory is located in the local filesystem.

The altURL are defined using the entities as:

<altURL    rdf:resource="&git;owl-schema/master/ext/user/budauser.ttl"/>

or

<altURL    rdf:resource="&local;owl-schema/ext/user/budauser.ttl"/>

See commits 3f7a5ff and 36c18ee.

Hopefully this helps.

xristy commented 4 years ago

Closing since addressed in owl-schema #169