Protégé import from http://w3id.org/XXX - owl

I am having problems importing two ontologies in Protégé. These ontologies are stored in the following links Onto1 and Onto2 and are also in the W3ID.ORG URL re-direction service (Onto1Redirection and Onto2Redirection).
I tried to import both of them using Protege's Direct Import => Add => Import an ontology contained in a document located on the web option. I tried introducing both the original OWL file's and the redirection URL.
However, after saving the ontology and loading it, imports are not correctly done (i.e. one or the other is not imported).
Any guidance in this matter will be appreciated.

Related

How to create a dynamic basePath in Next.js config

I want to do three things in my application, but I’m not figuring out how I could do that using Next.js router.
The default URL of the application should be 'https://localhost:3000/en'
It should also be possible to have 'https://localhost:3000/es' as a valid URL
Anything different than '/es' should redirect to '/en'
(This parameter will influence on the displayed language of the application.)
Considering those three points, should I create inside pages folder a new folder called language and put my index.tsx file and all the others routes that I have?
Example here
If I do that, what are the rules that I should create on my next.config.js to match with the criteria that I listed above? If not, what could be another approach to solve this?

Get a list of files in a react web application

I have a directory full of text files that I need to read in my react web app
-resources
|-file1.txt
|-file2.txt
|-file3.txt
I would like to store this resources directory somewhere in the app such that the contents of resources can be listed, and individual files can be iterated over on a line-by-line basis.
currently, I'm stuck on listing the files. I'm storing them like this
-node_modules
-public
|-resources
||-file1.txt
||-...
-src
But I really don't care where the resources directory is located. I tried using list-react-files based on this, but got Module not found: Error: Can't resolve 'fs'.
for further context, I was thinking the code to scan for files would be in in App.js, such that the scanned files could be used to populate certain components.
import React from "react"
import './App.css';
...
function App() {
//searching for files
var files = [...];
return(
//create components which can list and work with the files
...
);
}
export default App;
So, to summarize the question, how can I list files in reactJS?
p.s.:
this project was made with create-react-app
part of the point is that it should be easy to add new files to this directory, but I see no reason this process has to be "dynamic"
When people are using your react page, it is "running" on their computer and the software does not have access to all the files and data you'd like to use.
You will need to do this at "build time" when your service is being packaged up, or "on the server".
When you are building your react app, you can hook into processes that can find files and perform operations on them. Gatsby might be your best bet. Look at how people add "markup" files to their projects, built a menu from them and then render them as blog articles. NextJS, Vite, and other frameworks and tools will work, you may just need to learn a bit more.
The other approach, to do this "on the server" means when you are running code on the server you can do almost anything you like. So, your react app would make a call (e.g. rest request) to the server (e.g. NodeJS), and the code running on the server can use fs and other APIs to accomplish what you'd like.
From what you describe, doing this as part of your build step is probably the best route. A much easier route is to move this data into a JSON file and/or a database and not crawl the file system.
Looks like its a client side rendering app and not server side (node app). Resources folder you trying to list is residing in server and react app (javascript) running on browser can't access it directly.
To whom it may concern, I spent more time than I should have working on this. I highly recommend converting everything to JSON files and importing them. If you want to be able to scan for JSON files, make a JSON file that includes the names of all your files, then import that and use that for scanning. Doing things dynamically is a bare.
If you don't reformat, you'll likely need to use Fetch, which is asynchronous, which opens up a whole can of worms if you're using a framework like React.
If you're just importing json files, it's super easy:
import files from './resources/index.json';
where index.json looks like
{
"files":[
"file1.json",
"file2.json"
]
}
if you need to import the files more dynamically (not at the very beginning) you can use this:
var data = require('./resources/'+filename)
this will allow you to scan through your files using the index.json file, and load them dynamically as needed.

Unable to import a custom cs class in tsx file

In my asp.net core application, I received the following error when I try to import the Actor class which resides in the folder called Models.
Below, I share the folder structure of the project.
Below is the configuration file for typscript:
Any ideas why I should be receiving this error?
You cannot use C# classes in typescript. You have to create classes with similar structure in typescript and then use them. Also you can consider using some tools for generating ts classes from C#. This thead might be helpful as well.

Drupal 7 import page programmatically

I'm trying to create script for auto data import from one drupal site to other.
I have site foo.com and bar.com I'm trying to import everything from bar.com into foo.com.
So far I've managed to write script that imports all content types, nodes, blocks, etc. All that left is to import page with content. CTools module has clear function to export page data (panels, varants and etc...) but i cant find import function. (in admin panel there is way to import exported page, but import goes through a lot of functions, its too difficult to track all the way)
Is there an easer way to import page programmatically?
If you want to import anything from one site to another you are doing a site synchronization. And the best tool for this is Drush and commands rsync and sql-sync. See at Using Drush to synchronize and deploy sites.
If you want to import only Panel Pages you may use the Panel Import and of course Features.
An alternative option is Demo module to create site snapshots. Then a custom module can be used with a button to enable a demo snapshot.
And a more alternative idea is to create some feature modules (that add content, views, panels etc) and then a simple module that will have all these modules as required.

Ontology not getting data from imported ontology

I have an ontology and I use the OWL API to import another ontology,
OWLImportsDeclaration importDeclaraton = Factory.getOWLImportsDeclaration(IRI.create("file:/path/to/ontology.owl"));
ontology.getOWLOntologyManager().applyChange(new AddImport(ontology, importDeclaraton));
The new ontology contain some abox assertions in it, however, when I query the ontology for its abox axioms, there is nothing in it.
System.out.println(ontology.getABoxAxioms(true));
returns []
At the moment the OWL API does not seem to load imports on the fly, i.e., when a new import is added programmatically - it will attach the imported ontology if that ontology is already loaded, but it will not load a new ontology when the import is added.
I think this is a bug - there should at least be an option to load ontologies used in imports at the time the import is created. I'll add an issue for this.
Updates will be available here.

Resources